1<?php 2/* 3 * Copyright 2014 Google Inc. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 * use this file except in compliance with the License. You may obtain a copy of 7 * the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 * License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 18namespace Google\Service\Books\Resource; 19 20use Google\Service\Books\Annotation; 21use Google\Service\Books\Annotations; 22use Google\Service\Books\AnnotationsSummary; 23use Google\Service\Books\BooksEmpty; 24 25/** 26 * The "annotations" collection of methods. 27 * Typical usage is: 28 * <code> 29 * $booksService = new Google\Service\Books(...); 30 * $annotations = $booksService->annotations; 31 * </code> 32 */ 33class MylibraryAnnotations extends \Google\Service\Resource 34{ 35 /** 36 * Deletes an annotation. (annotations.delete) 37 * 38 * @param string $annotationId The ID for the annotation to delete. 39 * @param array $optParams Optional parameters. 40 * 41 * @opt_param string source String to identify the originator of this request. 42 * @return BooksEmpty 43 */ 44 public function delete($annotationId, $optParams = []) 45 { 46 $params = ['annotationId' => $annotationId]; 47 $params = array_merge($params, $optParams); 48 return $this->call('delete', [$params], BooksEmpty::class); 49 } 50 /** 51 * Inserts a new annotation. (annotations.insert) 52 * 53 * @param Annotation $postBody 54 * @param array $optParams Optional parameters. 55 * 56 * @opt_param string annotationId The ID for the annotation to insert. 57 * @opt_param string country ISO-3166-1 code to override the IP-based location. 58 * @opt_param bool showOnlySummaryInResponse Requests that only the summary of 59 * the specified layer be provided in the response. 60 * @opt_param string source String to identify the originator of this request. 61 * @return Annotation 62 */ 63 public function insert(Annotation $postBody, $optParams = []) 64 { 65 $params = ['postBody' => $postBody]; 66 $params = array_merge($params, $optParams); 67 return $this->call('insert', [$params], Annotation::class); 68 } 69 /** 70 * Retrieves a list of annotations, possibly filtered. 71 * (annotations.listMylibraryAnnotations) 72 * 73 * @param array $optParams Optional parameters. 74 * 75 * @opt_param string contentVersion The content version for the requested 76 * volume. 77 * @opt_param string layerId The layer ID to limit annotation by. 78 * @opt_param string layerIds The layer ID(s) to limit annotation by. 79 * @opt_param string maxResults Maximum number of results to return 80 * @opt_param string pageToken The value of the nextToken from the previous 81 * page. 82 * @opt_param bool showDeleted Set to true to return deleted annotations. 83 * updatedMin must be in the request to use this. Defaults to false. 84 * @opt_param string source String to identify the originator of this request. 85 * @opt_param string updatedMax RFC 3339 timestamp to restrict to items updated 86 * prior to this timestamp (exclusive). 87 * @opt_param string updatedMin RFC 3339 timestamp to restrict to items updated 88 * since this timestamp (inclusive). 89 * @opt_param string volumeId The volume to restrict annotations to. 90 * @return Annotations 91 */ 92 public function listMylibraryAnnotations($optParams = []) 93 { 94 $params = []; 95 $params = array_merge($params, $optParams); 96 return $this->call('list', [$params], Annotations::class); 97 } 98 /** 99 * Gets the summary of specified layers. (annotations.summary) 100 * 101 * @param string|array $layerIds Array of layer IDs to get the summary for. 102 * @param string $volumeId Volume id to get the summary for. 103 * @param array $optParams Optional parameters. 104 * @return AnnotationsSummary 105 */ 106 public function summary($layerIds, $volumeId, $optParams = []) 107 { 108 $params = ['layerIds' => $layerIds, 'volumeId' => $volumeId]; 109 $params = array_merge($params, $optParams); 110 return $this->call('summary', [$params], AnnotationsSummary::class); 111 } 112 /** 113 * Updates an existing annotation. (annotations.update) 114 * 115 * @param string $annotationId The ID for the annotation to update. 116 * @param Annotation $postBody 117 * @param array $optParams Optional parameters. 118 * 119 * @opt_param string source String to identify the originator of this request. 120 * @return Annotation 121 */ 122 public function update($annotationId, Annotation $postBody, $optParams = []) 123 { 124 $params = ['annotationId' => $annotationId, 'postBody' => $postBody]; 125 $params = array_merge($params, $optParams); 126 return $this->call('update', [$params], Annotation::class); 127 } 128} 129 130// Adding a class alias for backwards compatibility with the previous class name. 131class_alias(MylibraryAnnotations::class, 'Google_Service_Books_Resource_MylibraryAnnotations'); 132