Timeline: delete
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
نیاز به مجوز دارد
یک مورد جدول زمانی را حذف می کند. یک نمونه ببینید .
درخواست کنید
درخواست HTTP
DELETE https://www.googleapis.com/mirror/v1/timeline/id
پارامترها
نام پارامتر | ارزش | توضیحات |
---|
پارامترهای مسیر |
id | string | شناسه مورد خط زمانی. |
مجوز
این درخواست به مجوز حداقل با یکی از حوزه های زیر نیاز دارد ( در مورد احراز هویت و مجوز بیشتر بخوانید ).
دامنه |
---|
https://www.googleapis.com/auth/glass.timeline |
https://www.googleapis.com/auth/glass.location |
درخواست بدن
با این روش بدنه درخواستی ارائه نکنید.
پاسخ
در صورت موفقیت آمیز بودن، این روش یک بدنه پاسخ خالی را برمی گرداند.
نمونه ها
توجه: نمونههای کد موجود برای این روش همه زبانهای برنامهنویسی پشتیبانیشده را نشان نمیدهند (برای فهرست زبانهای پشتیبانیشده به صفحه کتابخانههای سرویس گیرنده مراجعه کنید).
جاوا
از کتابخانه سرویس گیرنده جاوا استفاده می کند.
import com.google.api.services.mirror.Mirror;
import java.io.IOException;
public class MyClass {
// ...
/**
* Delete a timeline item.
*
* @param service Authorized Mirror service.
* @param itemId ID of the timeline item to delete.
*/
public static void deleteTimelineItem(Mirror service, String itemId) {
try {
service.timeline().delete(itemId).execute();
} catch (IOException e) {
System.err.println("An error occurred: " + e);
}
}
// ...
}
دات نت
از کتابخانه کلاینت دات نت استفاده می کند.
using System;
using Google.Apis.Mirror.v1;
public class MyClass {
// ...
/// <summary>
/// Delete a timeline item.
/// </summary>
/// <param name='service'>Authorized Mirror service.</param>
/// <param name='itemId'>ID of the timeline item to delete.</param>
public static void DeleteTimelineItem(MirrorService service,
String itemId) {
try {
service.Timeline.Delete(itemId).Fetch();
} catch (Exception e) {
Console.WriteLine("An exception occurred: " + e.Message);
}
}
// ...
}
PHP
از کتابخانه مشتری PHP استفاده می کند.
/**
* Delete a timeline item.
*
* @param Google_MirrorService $service Authorized Mirror service.
* @param string $itemId ID of the timeline item to delete.
*/
function deleteTimelineItem($service, $itemId) {
try {
$service->timeline->delete($itemId);
} catch (Exception $e) {
print 'An error occurred: ' . $e->getMessage();
}
}
پایتون
از کتابخانه کلاینت پایتون استفاده می کند.
from apiclient import errors
# ...
def delete_timeline_item(service, item_id):
"""Delete a timeline item.
Args:
service: Authorized Mirror service.
item_id: ID of the timeline item to delete.
"""
try:
service.timeline().delete(id=item_id).execute()
except errors.HttpError, e:
print 'An error occurred: %s' % error
روبی
از کتابخانه کلاینت Ruby استفاده می کند.
##
# Delete a Timeline Item.
#
# @param [Google::APIClient] client
# Authorized client instance.
# @param [string] item_id
# ID of the timeline item to delete.
# @return nil
def delete_timeline_item(client, item_id)
mirror = client.discovered_api('mirror', 'v1')
result = client.execute(
:api_method => mirror.timeline.delete,
:parameters => { 'id' => item_id })
if result.error?
puts "An error occurred: #{result.data['error']['message']}"
end
end
برو
از کتابخانه سرویس گیرنده Go استفاده می کند.
import (
"code.google.com/p/google-api-go-client/mirror/v1"
"fmt"
)
// DeleteTimelineItem deletes a timeline item.
func DeleteTimelineItem(g *mirror.Service, itemId string) error {
err := g.Timeline.Delete(itemId).Do()
if err != nil {
fmt.Printf("An error occurred: %v\n", err)
}
return err
}
HTTP خام
از کتابخانه مشتری استفاده نمی کند.
DELETE /mirror/v1/timeline/timeline item id HTTP/1.1
Host: www.googleapis.com
Authorization: Bearer auth token
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-01-10 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-01-10 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eDeletes a specified timeline item using its ID.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with either \u003ccode\u003ehttps://www.googleapis.com/auth/glass.timeline\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/glass.location\u003c/code\u003e scope.\u003c/p\u003e\n"],["\u003cp\u003eThe request is made with a \u003ccode\u003eDELETE\u003c/code\u003e method to the endpoint \u003ccode\u003ehttps://www.googleapis.com/mirror/v1/timeline/id\u003c/code\u003e, substituting \u003ccode\u003eid\u003c/code\u003e with the actual timeline item ID.\u003c/p\u003e\n"],["\u003cp\u003eIf successful, the request returns an empty response body.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries and a raw HTTP request example are provided for various programming languages, including Java, .NET, PHP, Python, Ruby, and Go.\u003c/p\u003e\n"]]],[],null,["# Timeline: delete\n\n**Requires [authorization](#auth)**\n\nDeletes a timeline item.\n[See an example](#examples).\n\nRequest\n-------\n\n### HTTP request\n\n```\nDELETE https://www.googleapis.com/mirror/v1/timeline/id\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|----------|------------------------------|\n| **Path parameters** |||\n| `id` | `string` | The ID of the timeline item. |\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes ([read more about authentication and authorization](/glass/authorization)).\n\n| Scope |\n|--------------------------------------------------|\n| `https://www.googleapis.com/auth/glass.timeline` |\n| `https://www.googleapis.com/auth/glass.location` |\n\n### Request body\n\nDo not supply a request body with this method.\n\nResponse\n--------\n\nIf successful, this method returns an empty response body.\n\nExamples\n--------\n\n**Note:** The code examples available for this method do not represent all supported programming languages (see the [client libraries page](/glass/tools-downloads/client-libraries) for a list of supported languages). \n\n### Java\n\nUses the [Java client library](/glass/tools-downloads/client-libraries). \n\n```java\nimport com.google.api.services.mirror.Mirror;\n\nimport java.io.IOException;\n\npublic class MyClass {\n // ...\n\n /**\n * Delete a timeline item.\n * \n * @param service Authorized Mirror service.\n * @param itemId ID of the timeline item to delete.\n */\n public static void deleteTimelineItem(Mirror service, String itemId) {\n try {\n service.timeline().delete(itemId).execute();\n } catch (IOException e) {\n System.err.println(\"An error occurred: \" + e);\n }\n }\n\n // ...\n}\n```\n\n### .NET\n\nUses the [.NET client library](/glass/tools-downloads/client-libraries). \n\n```css+lasso\nusing System;\n\nusing Google.Apis.Mirror.v1;\n\npublic class MyClass {\n // ...\n\n /// \u003csummary\u003e\n /// Delete a timeline item.\n /// \u003c/summary\u003e\n /// \u003cparam name='service'\u003eAuthorized Mirror service.\u003c/param\u003e\n /// \u003cparam name='itemId'\u003eID of the timeline item to delete.\u003c/param\u003e\n public static void DeleteTimelineItem(MirrorService service,\n String itemId) {\n try {\n service.Timeline.Delete(itemId).Fetch();\n } catch (Exception e) {\n Console.WriteLine(\"An exception occurred: \" + e.Message);\n }\n }\n\n // ...\n}\n```\n\n### PHP\n\nUses the [PHP client library](/glass/tools-downloads/client-libraries). \n\n```php\n/**\n * Delete a timeline item.\n *\n * @param Google_MirrorService $service Authorized Mirror service.\n * @param string $itemId ID of the timeline item to delete.\n */\nfunction deleteTimelineItem($service, $itemId) {\n try {\n $service-\u003etimeline-\u003edelete($itemId);\n } catch (Exception $e) {\n print 'An error occurred: ' . $e-\u003egetMessage();\n }\n}\n```\n\n### Python\n\nUses the [Python client library](/glass/tools-downloads/client-libraries). \n\n```python\nfrom apiclient import errors\n# ...\n\ndef delete_timeline_item(service, item_id):\n \"\"\"Delete a timeline item.\n\n Args:\n service: Authorized Mirror service.\n item_id: ID of the timeline item to delete.\n \"\"\"\n try:\n service.timeline().delete(id=item_id).execute()\n except errors.HttpError, e:\n print 'An error occurred: %s' % error\n```\n\n### Ruby\n\nUses the [Ruby client library](/glass/tools-downloads/client-libraries). \n\n```ruby\n##\n# Delete a Timeline Item.\n#\n# @param [Google::APIClient] client\n# Authorized client instance.\n# @param [string] item_id\n# ID of the timeline item to delete.\n# @return nil\ndef delete_timeline_item(client, item_id)\n mirror = client.discovered_api('mirror', 'v1')\n result = client.execute(\n :api_method =\u003e mirror.timeline.delete,\n :parameters =\u003e { 'id' =\u003e item_id })\n if result.error?\n puts \"An error occurred: #{result.data['error']['message']}\"\n end\nend\n```\n\n### Go\n\nUses the [Go client library](/glass/tools-downloads/client-libraries). \n\n```go\nimport (\n\t\"code.google.com/p/google-api-go-client/mirror/v1\"\n\t\"fmt\"\n)\n\n// DeleteTimelineItem deletes a timeline item.\nfunc DeleteTimelineItem(g *mirror.Service, itemId string) error {\n\terr := g.Timeline.Delete(itemId).Do()\n\tif err != nil {\n\t\tfmt.Printf(\"An error occurred: %v\\n\", err)\n\t}\n\treturn err\n}\n```\n\n### Raw HTTP\n\nDoes not use a client library. \n\n```text\nDELETE /mirror/v1/timeline/timeline item id HTTP/1.1\nHost: www.googleapis.com\nAuthorization: Bearer auth token\n```"]]