Beispiel #1
0
 /**
  * https://qiita.com/api/v2/docs#delete-apiv2itemsitem_idtaggingstagging_id
  * @param ItemId $itemId
  * @param TagId $tagId
  */
 public function deleteItemsItemIdTagginsTaggingId(ItemId $itemId, TagId $tagId)
 {
     try {
         //@todo 404の時だけfalseを返すようにする
         $response = $this->httpClient->delete(static::$teamAPIEntoryPoint . 'items/' . $itemId->getRawId() . '/taggings/' . $tagId->getRawId());
     } catch (\Exception $e) {
         return false;
     }
     return true;
 }
Beispiel #2
0
 /**
  * https://qiita.com/api/v2/docs#get-apiv2tagstag_iditems
  * @param TagId $tagId
  */
 public function getTagsTagIdItems(TagId $tagId)
 {
     $response = $this->httpClient->get($this->apiEntryPoint() . 'tags/' . $tagId->getRawId() . '/items');
     return array_map(function ($item) {
         $item = self::objectToArray($item);
         return $this->factory->make('item', ['parameters' => $item]);
     }, $response);
 }