Timeline.attachments: list

অনুমোদন প্রয়োজন

একটি টাইমলাইন আইটেমের জন্য সংযুক্তির একটি তালিকা প্রদান করে। একটি উদাহরণ দেখুন

অনুরোধ

HTTP অনুরোধ

GET https://www.googleapis.com/mirror/v1/timeline/itemId/attachments

পরামিতি

পরামিতি নাম মান বর্ণনা
পাথ প্যারামিটার
itemId string টাইমলাইন আইটেমের আইডি যার সংযুক্তিগুলি তালিকাভুক্ত করা উচিত৷

অনুমোদন

এই অনুরোধের জন্য নিম্নলিখিত সুযোগের সাথে অনুমোদনের প্রয়োজন ( প্রমাণিকরণ এবং অনুমোদন সম্পর্কে আরও পড়ুন )।

ব্যাপ্তি
https://www.googleapis.com/auth/glass.timeline

শরীরের অনুরোধ

এই পদ্ধতির সাথে একটি অনুরোধ সংস্থা সরবরাহ করবেন না।

প্রতিক্রিয়া

সফল হলে, এই পদ্ধতিটি নিম্নলিখিত কাঠামো সহ একটি প্রতিক্রিয়া বডি প্রদান করে:

{
  "kind": "mirror#attachmentsList",
  "items": [
    timeline.attachments Resource
  ]
}
সম্পত্তির নাম মান বর্ণনা মন্তব্য
kind string সম্পদের ধরন। এটি সর্বদা mirror#attachmentsList
items[] list সংযুক্তি তালিকা.

উদাহরণ

দ্রষ্টব্য: এই পদ্ধতির জন্য উপলব্ধ কোড উদাহরণগুলি সমস্ত সমর্থিত প্রোগ্রামিং ভাষার প্রতিনিধিত্ব করে না (সমর্থিত ভাষার তালিকার জন্য ক্লায়েন্ট লাইব্রেরি পৃষ্ঠা দেখুন)।

জাভা

জাভা ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

import com.google.api.services.mirror.Mirror;
import com.google.api.services.mirror.model.Attachment;
import com.google.api.services.mirror.model.AttachmentsListResponse;

import java.io.IOException;

public class MyClass {
  // ...

  /**
   * Print all attachments' metadata.
   * 
   * @param service Authorized Mirror service.
   * @param itemId ID of the timeline item the attachments belong to.
   */
  public static void printAllAttachmentsMetadata(Mirror service, String itemId) {
    try {
      AttachmentsListResponse attachments = service.timeline().attachments().list(itemId).execute();

      for (Attachment attachment : attachments.getItems()) {
        System.out.println("Attachment content type: " + attachment.getContentType());
        System.out.println("Attachment content URL: " + attachment.getContentUrl());
      }
    } catch (IOException e) {
      System.out.println("An error occured: " + e);
    }

  }

  // ...
}

.নেট

.NET ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

using System;
using Google.Apis.Mirror.v1;
using Google.Apis.Mirror.v1.Data;

public class MyClass {
  // ...

  /// <summary>
  /// Print all attachments' metadata.
  /// </summary>
  /// <param name="service">Authorized Mirror service.</param>
  /// <param name="itemId">ID of the timeline item the attachments belong to.</param>
  public static void PrintAllAttachmentsMetadata(MirrorService service, String itemId) {
    try {
      AttachmentsListResponse attachments = service.Timeline.Attachments.List(itemId).Fetch();

      foreach (Attachment attachment in attachments.Items) {
        Console.WriteLine("Attachment content type: " + attachment.ContentType);
        Console.WriteLine("Attachment content URL: " + attachment.ContentUrl);
      }
    } catch (Exception e) {
      Console.WriteLine("An error occurred: " + e.Message);
    }
  }

  // ...
}

পিএইচপি

পিএইচপি ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

/**
 * Print all attachments' metadata.
 *
 * @param Google_MirrorService $service Authorized Mirror service.
 * @param string $itemId ID of the timeline item the attachments belong to.
 */
function printAllAttachmentsMetadata($service, $itemId) {
  try {
    $attachments = $service->timeline_attachments->listTimelineAttachments(
        $itemId);

    foreach ($attachments->getItems() as $attachment) {
      print "Attachment content type: " . $attachment->getContentType() . "\n";
      print "Attachment content URL: " . $attachment->getContentUrl() . "\n";
    }
  } catch (Exception $e) {
    print "An error occurred: " . $e->getMessage();
  }
}

পাইথন

পাইথন ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

from apiclient import errors
# ...

def print_all_attachments_metadata(service, item_id):
  """Print all attachments' metadata.

  Args:
    service: Authorized Mirror service.
    item_id: ID of the timeline item the attachments belong to.
  """
  try:
    attachments = service.timeline().attachments().list(
        itemId=item_id).execute()
    for attachment in attachments.get('items', []):
      print 'Attachment content type: %s' % attachment['contentType']
      print 'Attachment content URL: %s' % attachment['contentUrl']
  except errors.HttpError, error:
    print 'An error occurred: %s' % error

রুবি

রুবি ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

##
# Print all attachments' metadata.
#
# @param [Google::APIClient] client
#   Authorized client instance.
# @param [String] item_id
#   ID of the timeline item the attachments belong to.
# @return nil
def print_all_attachments_metadata(client, item_id)
  mirror = client.discovered_api('mirror', 'v1')
  result = client.execute(
    :api_method => mirror.timeline.attachments.list,
    :parameters => { 'itemId' => item_id })
  if result.success?
    attachments = result.data
    attachments.items.each do |attachment|
      puts "Attachment content type: #{attachment.content_type}"
      puts "Attachment content URL: #{attachment.content_url}"
    end
  else
    puts "An error occurred: #{result.data['error']['message']}"
  end
end

কাঁচা HTTP

একটি ক্লায়েন্ট লাইব্রেরি ব্যবহার করে না।

GET /mirror/v1/timeline/timeline item id/attachments HTTP/1.1
Host: www.googleapis.com
Authorization: Bearer auth token
,

অনুমোদন প্রয়োজন

একটি টাইমলাইন আইটেমের জন্য সংযুক্তির একটি তালিকা প্রদান করে। একটি উদাহরণ দেখুন

অনুরোধ

HTTP অনুরোধ

GET https://www.googleapis.com/mirror/v1/timeline/itemId/attachments

পরামিতি

পরামিতি নাম মান বর্ণনা
পাথ প্যারামিটার
itemId string টাইমলাইন আইটেমের আইডি যার সংযুক্তিগুলি তালিকাভুক্ত করা উচিত৷

অনুমোদন

এই অনুরোধের জন্য নিম্নলিখিত সুযোগের সাথে অনুমোদনের প্রয়োজন ( প্রমাণিকরণ এবং অনুমোদন সম্পর্কে আরও পড়ুন )।

ব্যাপ্তি
https://www.googleapis.com/auth/glass.timeline

শরীরের অনুরোধ

এই পদ্ধতির সাথে একটি অনুরোধ সংস্থা সরবরাহ করবেন না।

প্রতিক্রিয়া

সফল হলে, এই পদ্ধতিটি নিম্নলিখিত কাঠামো সহ একটি প্রতিক্রিয়া বডি প্রদান করে:

{
  "kind": "mirror#attachmentsList",
  "items": [
    timeline.attachments Resource
  ]
}
সম্পত্তির নাম মান বর্ণনা মন্তব্য
kind string সম্পদের ধরন। এটি সর্বদা mirror#attachmentsList
items[] list সংযুক্তি তালিকা.

উদাহরণ

দ্রষ্টব্য: এই পদ্ধতির জন্য উপলব্ধ কোড উদাহরণগুলি সমস্ত সমর্থিত প্রোগ্রামিং ভাষার প্রতিনিধিত্ব করে না (সমর্থিত ভাষার তালিকার জন্য ক্লায়েন্ট লাইব্রেরি পৃষ্ঠা দেখুন)।

জাভা

জাভা ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

import com.google.api.services.mirror.Mirror;
import com.google.api.services.mirror.model.Attachment;
import com.google.api.services.mirror.model.AttachmentsListResponse;

import java.io.IOException;

public class MyClass {
  // ...

  /**
   * Print all attachments' metadata.
   * 
   * @param service Authorized Mirror service.
   * @param itemId ID of the timeline item the attachments belong to.
   */
  public static void printAllAttachmentsMetadata(Mirror service, String itemId) {
    try {
      AttachmentsListResponse attachments = service.timeline().attachments().list(itemId).execute();

      for (Attachment attachment : attachments.getItems()) {
        System.out.println("Attachment content type: " + attachment.getContentType());
        System.out.println("Attachment content URL: " + attachment.getContentUrl());
      }
    } catch (IOException e) {
      System.out.println("An error occured: " + e);
    }

  }

  // ...
}

.নেট

.NET ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

using System;
using Google.Apis.Mirror.v1;
using Google.Apis.Mirror.v1.Data;

public class MyClass {
  // ...

  /// <summary>
  /// Print all attachments' metadata.
  /// </summary>
  /// <param name="service">Authorized Mirror service.</param>
  /// <param name="itemId">ID of the timeline item the attachments belong to.</param>
  public static void PrintAllAttachmentsMetadata(MirrorService service, String itemId) {
    try {
      AttachmentsListResponse attachments = service.Timeline.Attachments.List(itemId).Fetch();

      foreach (Attachment attachment in attachments.Items) {
        Console.WriteLine("Attachment content type: " + attachment.ContentType);
        Console.WriteLine("Attachment content URL: " + attachment.ContentUrl);
      }
    } catch (Exception e) {
      Console.WriteLine("An error occurred: " + e.Message);
    }
  }

  // ...
}

পিএইচপি

পিএইচপি ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

/**
 * Print all attachments' metadata.
 *
 * @param Google_MirrorService $service Authorized Mirror service.
 * @param string $itemId ID of the timeline item the attachments belong to.
 */
function printAllAttachmentsMetadata($service, $itemId) {
  try {
    $attachments = $service->timeline_attachments->listTimelineAttachments(
        $itemId);

    foreach ($attachments->getItems() as $attachment) {
      print "Attachment content type: " . $attachment->getContentType() . "\n";
      print "Attachment content URL: " . $attachment->getContentUrl() . "\n";
    }
  } catch (Exception $e) {
    print "An error occurred: " . $e->getMessage();
  }
}

পাইথন

পাইথন ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

from apiclient import errors
# ...

def print_all_attachments_metadata(service, item_id):
  """Print all attachments' metadata.

  Args:
    service: Authorized Mirror service.
    item_id: ID of the timeline item the attachments belong to.
  """
  try:
    attachments = service.timeline().attachments().list(
        itemId=item_id).execute()
    for attachment in attachments.get('items', []):
      print 'Attachment content type: %s' % attachment['contentType']
      print 'Attachment content URL: %s' % attachment['contentUrl']
  except errors.HttpError, error:
    print 'An error occurred: %s' % error

রুবি

রুবি ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

##
# Print all attachments' metadata.
#
# @param [Google::APIClient] client
#   Authorized client instance.
# @param [String] item_id
#   ID of the timeline item the attachments belong to.
# @return nil
def print_all_attachments_metadata(client, item_id)
  mirror = client.discovered_api('mirror', 'v1')
  result = client.execute(
    :api_method => mirror.timeline.attachments.list,
    :parameters => { 'itemId' => item_id })
  if result.success?
    attachments = result.data
    attachments.items.each do |attachment|
      puts "Attachment content type: #{attachment.content_type}"
      puts "Attachment content URL: #{attachment.content_url}"
    end
  else
    puts "An error occurred: #{result.data['error']['message']}"
  end
end

কাঁচা HTTP

একটি ক্লায়েন্ট লাইব্রেরি ব্যবহার করে না।

GET /mirror/v1/timeline/timeline item id/attachments HTTP/1.1
Host: www.googleapis.com
Authorization: Bearer auth token