دوربین.حذف
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
فایلی را با توجه به URI آن حذف می کند. این دستور در سطح 2 API اصلاح شد.
پارامترها
- API سطح 1
- fileUri: URI یک فایل برای حذف. تولیدکنندگان تصمیم می گیرند که از URI های مطلق یا نسبی استفاده کنند. مشتریان ممکن است این را به عنوان یک شناسه غیر شفاف تلقی کنند.
- API سطح 2
- fileUrls: فهرستی از URL های مطلق فایل هایی که باید از دوربین حذف شوند، که قبلاً به دست آمده بودند، به عنوان مثال از دستورات
camera.listFiles
یا camera.takePicture
. سه مورد خاص وجود دارد:- لیست فقط شامل رشته "همه" است: تمام فایل های دوربین را حذف کنید.
- لیست فقط شامل رشته "تصویر" است: تمام تصاویر موجود در دوربین را حذف کنید.
- لیست فقط شامل رشته "ویدئو" است: تمام ویدیوهای موجود در دوربین را حذف کنید.
نتایج
- fileUrls: آدرس فایلهایی که با موفقیت حذف نشدهاند. لطفاً توجه داشته باشید که این زمانی اتفاق میافتد که همه URLهای موجود در fileUrls معتبر باشند اما دوربین نتواند برخی از آنها را حذف کند. اگر هر یک از URL ها نامعتبر است، کد خطا
invalidParameterValue
باید بدون حذف هیچ فایلی برگردانده شود. این در سطح 2 API اضافه شد.
خطاها
- missingParameter:
fileUri
مشخص نشده است. - invalidParameterName: نام پارامتر ورودی شناسایی نشده است.
- invalidParameterValue: نام پارامتر ورودی شناسایی می شود، اما مقدار آن نامعتبر است. به عنوان مثال،
fileUri
در سطح API 1 وجود ندارد یا هر URL در fileUrls در سطح API 2 وجود ندارد.
دستور I/O |
---|
ورودی فرمان (سطح API 1) | {
"parameters": {
"fileUri": "file URI"
}
} |
خروجی فرمان (سطح API 1) | none | خروجی فرمان (خطا) (سطح API 1) | {
"error": {
"code": "invalidParameterName",
"message": "Parameter XYZ is unrecognized."
}
} |
ورودی فرمان (سطح API 2) | {
"parameters": {
"fileUrls": [
"url1",
"url2",
"url3",
...
"urln"
]
}
} |
خروجی فرمان (سطح 2 API) | {
"results": {
"fileUrls": [
"urln"
]
}
} | خروجی فرمان (خطا) (سطح API 2) | {
"error": {
"code": "invalidParameterValue",
"message": "Parameter url3 doesn't exist."
}
} |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2024-11-09 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2024-11-09 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe \u003ccode\u003edeleteFile\u003c/code\u003e command removes one or more files from the camera's storage.\u003c/p\u003e\n"],["\u003cp\u003eAPI level 1 uses \u003ccode\u003efileUri\u003c/code\u003e to specify a single file for deletion, while API level 2 uses \u003ccode\u003efileUrls\u003c/code\u003e to specify one or more files, or uses special values to delete all files, all images, or all videos.\u003c/p\u003e\n"],["\u003cp\u003eErrors are returned if parameters are missing, invalid, or if the specified files cannot be deleted.\u003c/p\u003e\n"],["\u003cp\u003eAPI level 2 introduced the \u003ccode\u003efileUrls\u003c/code\u003e parameter and the ability to return a list of unsuccessfully deleted files in the results.\u003c/p\u003e\n"]]],["This describes a command to delete files from a camera. In API level 1, it accepts a `fileUri` to delete a single file, where the URI's format is determined by the manufacturer. API level 2 was introduced to use the `fileUrls` parameter for multiple files, specified by absolute URLs. Special strings like \"all\", \"image\", or \"video\" delete all files, all images, or all videos. A list of `fileUrls` will return any files that did not delete correctly. Errors include invalid parameters or missing data.\n"],null,["# camera.delete\n\nDeletes a file given its URI. **This command was modified in API level 2.**\n\nParameters\n----------\n\n- **API level 1**\n - **fileUri:** URI of a file to delete. Manufacturers decide whether to use absolute or relative URIs. Clients may treat this as an opaque identifier.\n- **API level 2**\n - **fileUrls:** A list of absolute URLs for files to be deleted from the camera, which were obtained previously, e.g. from [camera.listFiles](/streetview/open-spherical-camera/reference/camera/listfiles) or [camera.takePicture](/streetview/open-spherical-camera/reference/camera/takepicture) commands. There are three special cases:\n - The list only contains string \"all\": delete all files in the camera.\n - The list only contains string \"image\": delete all images in the camera.\n - The list only contains string \"video\": delete all videos in the camera.\n\nResults\n-------\n\n- **fileUrls:** URLs of files that are not successfully deleted. Please note this happens when all the URLs in fileUrls are valid but camera fails to delete some of them. If any of the URLs is invalid, error code `invalidParameterValue` should be returned without deleting any file. **This was added in API level 2.**\n\nErrors\n------\n\n- **missingParameter:** `fileUri` not specified.\n- **invalidParameterName:** The input parameter name is unrecognized.\n- **invalidParameterValue:** The input parameter name is recognized, but its value is invalid; for example, the `fileUri` doesn't exist in API level 1 or any URL in fileUrls doesn't exist in API level 2.\n\n| Command I/O ----------- ||\n|------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| **Command Input (API level 1)** | ```text { \"parameters\": { \"fileUri\": \"file URI\" } } ``` |\n| **Command Output (API level 1)** | ```text none ``` |\n| **Command Output (Error) (API level 1)** | ```text { \"error\": { \"code\": \"invalidParameterName\", \"message\": \"Parameter XYZ is unrecognized.\" } } ``` |\n| **Command Input (API level 2)** | ```text { \"parameters\": { \"fileUrls\": [ \"url1\", \"url2\", \"url3\", ... \"urln\" ] } } ``` |\n| **Command Output (API level 2)** | ```text { \"results\": { \"fileUrls\": [ \"urln\" ] } } ``` |\n| **Command Output (Error) (API level 2)** | ```text { \"error\": { \"code\": \"invalidParameterValue\", \"message\": \"Parameter url3 doesn't exist.\" } } ``` |"]]