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; 19 20use Google\Client; 21 22/** 23 * Service definition for Docs (v1). 24 * 25 * <p> 26 * Reads and writes Google Docs documents.</p> 27 * 28 * <p> 29 * For more information about this service, see the API 30 * <a href="https://developers.google.com/docs/" target="_blank">Documentation</a> 31 * </p> 32 * 33 * @author Google, Inc. 34 */ 35class Docs extends \Google\Service 36{ 37 /** See, edit, create, and delete all your Google Docs documents. */ 38 const DOCUMENTS = 39 "https://www.googleapis.com/auth/documents"; 40 /** See all your Google Docs documents. */ 41 const DOCUMENTS_READONLY = 42 "https://www.googleapis.com/auth/documents.readonly"; 43 /** See, edit, create, and delete all of your Google Drive files. */ 44 const DRIVE = 45 "https://www.googleapis.com/auth/drive"; 46 /** See, edit, create, and delete only the specific Google Drive files you use with this app. */ 47 const DRIVE_FILE = 48 "https://www.googleapis.com/auth/drive.file"; 49 /** See and download all your Google Drive files. */ 50 const DRIVE_READONLY = 51 "https://www.googleapis.com/auth/drive.readonly"; 52 53 public $documents; 54 55 /** 56 * Constructs the internal representation of the Docs service. 57 * 58 * @param Client|array $clientOrConfig The client used to deliver requests, or a 59 * config array to pass to a new Client instance. 60 * @param string $rootUrl The root URL used for requests to the service. 61 */ 62 public function __construct($clientOrConfig = [], $rootUrl = null) 63 { 64 parent::__construct($clientOrConfig); 65 $this->rootUrl = $rootUrl ?: 'https://docs.googleapis.com/'; 66 $this->servicePath = ''; 67 $this->batchPath = 'batch'; 68 $this->version = 'v1'; 69 $this->serviceName = 'docs'; 70 71 $this->documents = new Docs\Resource\Documents( 72 $this, 73 $this->serviceName, 74 'documents', 75 [ 76 'methods' => [ 77 'batchUpdate' => [ 78 'path' => 'v1/documents/{documentId}:batchUpdate', 79 'httpMethod' => 'POST', 80 'parameters' => [ 81 'documentId' => [ 82 'location' => 'path', 83 'type' => 'string', 84 'required' => true, 85 ], 86 ], 87 ],'create' => [ 88 'path' => 'v1/documents', 89 'httpMethod' => 'POST', 90 'parameters' => [], 91 ],'get' => [ 92 'path' => 'v1/documents/{documentId}', 93 'httpMethod' => 'GET', 94 'parameters' => [ 95 'documentId' => [ 96 'location' => 'path', 97 'type' => 'string', 98 'required' => true, 99 ], 100 'suggestionsViewMode' => [ 101 'location' => 'query', 102 'type' => 'string', 103 ], 104 ], 105 ], 106 ] 107 ] 108 ); 109 } 110} 111 112// Adding a class alias for backwards compatibility with the previous class name. 113class_alias(Docs::class, 'Google_Service_Docs'); 114