├── .env.example ├── .gitignore ├── Drive.php ├── LICENSE ├── README.md ├── client_secret.json.example ├── composer.json └── index.php /.env.example: -------------------------------------------------------------------------------- 1 | # Google Drive Credentials 2 | CREDENTIALS_NAME="google-drive.json" 3 | 4 | # Google Drive App Name 5 | APPLICATION_NAME="My Google Drive API" 6 | 7 | # Directory to save . This is ID of directory in your Google Drive 8 | # Fill as blank if you want to put file in your root directory 9 | DIRECTORY_TO_SAVE="IUusaydiuya87687a6d" 10 | 11 | # MYSQL CONFIGURATION 12 | MYSQL_HOST="localhost" 13 | MYSQL_DB_NAME="dbname" 14 | MYSQL_USER="root" 15 | MYSQL_PASSWORD="root" 16 | 17 | # SLACK CONFIG ; 0 deactive, 1 active 18 | SLACK=0 19 | SLACK_URL=https://hooks.slack.com/services/foo/bar/foo -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | composer.lock 3 | client_secret.json 4 | .env 5 | log.txt -------------------------------------------------------------------------------- /Drive.php: -------------------------------------------------------------------------------- 1 | 9 | * The API to interact with Drive.
10 | * 11 | *12 | * For more information about this service, see the API 13 | * Documentation 14 | *
15 | * 16 | * @author Google, Inc. 17 | */ 18 | class Google_Service_Drive extends Google_Service 19 | { 20 | /** View and manage the files in your Google Drive. */ 21 | const DRIVE = 22 | "https://www.googleapis.com/auth/drive"; 23 | /** View and manage its own configuration data in your Google Drive. */ 24 | const DRIVE_APPDATA = 25 | "https://www.googleapis.com/auth/drive.appdata"; 26 | /** View and manage Google Drive files and folders that you have opened or created with this app. */ 27 | const DRIVE_FILE = 28 | "https://www.googleapis.com/auth/drive.file"; 29 | /** View and manage metadata of files in your Google Drive. */ 30 | const DRIVE_METADATA = 31 | "https://www.googleapis.com/auth/drive.metadata"; 32 | /** View metadata for files in your Google Drive. */ 33 | const DRIVE_METADATA_READONLY = 34 | "https://www.googleapis.com/auth/drive.metadata.readonly"; 35 | /** View the photos, videos and albums in your Google Photos. */ 36 | const DRIVE_PHOTOS_READONLY = 37 | "https://www.googleapis.com/auth/drive.photos.readonly"; 38 | /** View the files in your Google Drive. */ 39 | const DRIVE_READONLY = 40 | "https://www.googleapis.com/auth/drive.readonly"; 41 | /** Modify your Google Apps Script scripts' behavior. */ 42 | const DRIVE_SCRIPTS = 43 | "https://www.googleapis.com/auth/drive.scripts"; 44 | 45 | public $about; 46 | public $changes; 47 | public $channels; 48 | public $comments; 49 | public $files; 50 | public $permissions; 51 | public $replies; 52 | public $revisions; 53 | 54 | 55 | /** 56 | * Constructs the internal representation of the Drive service. 57 | * 58 | * @param Google_Client $client 59 | */ 60 | public function __construct(Google_Client $client) 61 | { 62 | parent::__construct($client); 63 | $this->rootUrl = 'https://www.googleapis.com/'; 64 | $this->servicePath = 'drive/v3/'; 65 | $this->version = 'v3'; 66 | $this->serviceName = 'drive'; 67 | 68 | $this->about = new Google_Service_Drive_About_Resource( 69 | $this, 70 | $this->serviceName, 71 | 'about', 72 | array( 73 | 'methods' => array( 74 | 'get' => array( 75 | 'path' => 'about', 76 | 'httpMethod' => 'GET', 77 | 'parameters' => array(), 78 | ), 79 | ) 80 | ) 81 | ); 82 | $this->changes = new Google_Service_Drive_Changes_Resource( 83 | $this, 84 | $this->serviceName, 85 | 'changes', 86 | array( 87 | 'methods' => array( 88 | 'getStartPageToken' => array( 89 | 'path' => 'changes/startPageToken', 90 | 'httpMethod' => 'GET', 91 | 'parameters' => array(), 92 | ),'list' => array( 93 | 'path' => 'changes', 94 | 'httpMethod' => 'GET', 95 | 'parameters' => array( 96 | 'pageToken' => array( 97 | 'location' => 'query', 98 | 'type' => 'string', 99 | 'required' => true, 100 | ), 101 | 'spaces' => array( 102 | 'location' => 'query', 103 | 'type' => 'string', 104 | ), 105 | 'pageSize' => array( 106 | 'location' => 'query', 107 | 'type' => 'integer', 108 | ), 109 | 'includeRemoved' => array( 110 | 'location' => 'query', 111 | 'type' => 'boolean', 112 | ), 113 | 'restrictToMyDrive' => array( 114 | 'location' => 'query', 115 | 'type' => 'boolean', 116 | ), 117 | ), 118 | ),'watch' => array( 119 | 'path' => 'changes/watch', 120 | 'httpMethod' => 'POST', 121 | 'parameters' => array( 122 | 'pageToken' => array( 123 | 'location' => 'query', 124 | 'type' => 'string', 125 | 'required' => true, 126 | ), 127 | 'spaces' => array( 128 | 'location' => 'query', 129 | 'type' => 'string', 130 | ), 131 | 'pageSize' => array( 132 | 'location' => 'query', 133 | 'type' => 'integer', 134 | ), 135 | 'includeRemoved' => array( 136 | 'location' => 'query', 137 | 'type' => 'boolean', 138 | ), 139 | 'restrictToMyDrive' => array( 140 | 'location' => 'query', 141 | 'type' => 'boolean', 142 | ), 143 | ), 144 | ), 145 | ) 146 | ) 147 | ); 148 | $this->channels = new Google_Service_Drive_Channels_Resource( 149 | $this, 150 | $this->serviceName, 151 | 'channels', 152 | array( 153 | 'methods' => array( 154 | 'stop' => array( 155 | 'path' => 'channels/stop', 156 | 'httpMethod' => 'POST', 157 | 'parameters' => array(), 158 | ), 159 | ) 160 | ) 161 | ); 162 | $this->comments = new Google_Service_Drive_Comments_Resource( 163 | $this, 164 | $this->serviceName, 165 | 'comments', 166 | array( 167 | 'methods' => array( 168 | 'create' => array( 169 | 'path' => 'files/{fileId}/comments', 170 | 'httpMethod' => 'POST', 171 | 'parameters' => array( 172 | 'fileId' => array( 173 | 'location' => 'path', 174 | 'type' => 'string', 175 | 'required' => true, 176 | ), 177 | ), 178 | ),'delete' => array( 179 | 'path' => 'files/{fileId}/comments/{commentId}', 180 | 'httpMethod' => 'DELETE', 181 | 'parameters' => array( 182 | 'fileId' => array( 183 | 'location' => 'path', 184 | 'type' => 'string', 185 | 'required' => true, 186 | ), 187 | 'commentId' => array( 188 | 'location' => 'path', 189 | 'type' => 'string', 190 | 'required' => true, 191 | ), 192 | ), 193 | ),'get' => array( 194 | 'path' => 'files/{fileId}/comments/{commentId}', 195 | 'httpMethod' => 'GET', 196 | 'parameters' => array( 197 | 'fileId' => array( 198 | 'location' => 'path', 199 | 'type' => 'string', 200 | 'required' => true, 201 | ), 202 | 'commentId' => array( 203 | 'location' => 'path', 204 | 'type' => 'string', 205 | 'required' => true, 206 | ), 207 | 'includeDeleted' => array( 208 | 'location' => 'query', 209 | 'type' => 'boolean', 210 | ), 211 | ), 212 | ),'list' => array( 213 | 'path' => 'files/{fileId}/comments', 214 | 'httpMethod' => 'GET', 215 | 'parameters' => array( 216 | 'fileId' => array( 217 | 'location' => 'path', 218 | 'type' => 'string', 219 | 'required' => true, 220 | ), 221 | 'pageToken' => array( 222 | 'location' => 'query', 223 | 'type' => 'string', 224 | ), 225 | 'startModifiedTime' => array( 226 | 'location' => 'query', 227 | 'type' => 'string', 228 | ), 229 | 'includeDeleted' => array( 230 | 'location' => 'query', 231 | 'type' => 'boolean', 232 | ), 233 | 'pageSize' => array( 234 | 'location' => 'query', 235 | 'type' => 'integer', 236 | ), 237 | ), 238 | ),'update' => array( 239 | 'path' => 'files/{fileId}/comments/{commentId}', 240 | 'httpMethod' => 'PATCH', 241 | 'parameters' => array( 242 | 'fileId' => array( 243 | 'location' => 'path', 244 | 'type' => 'string', 245 | 'required' => true, 246 | ), 247 | 'commentId' => array( 248 | 'location' => 'path', 249 | 'type' => 'string', 250 | 'required' => true, 251 | ), 252 | ), 253 | ), 254 | ) 255 | ) 256 | ); 257 | $this->files = new Google_Service_Drive_Files_Resource( 258 | $this, 259 | $this->serviceName, 260 | 'files', 261 | array( 262 | 'methods' => array( 263 | 'copy' => array( 264 | 'path' => 'files/{fileId}/copy', 265 | 'httpMethod' => 'POST', 266 | 'parameters' => array( 267 | 'fileId' => array( 268 | 'location' => 'path', 269 | 'type' => 'string', 270 | 'required' => true, 271 | ), 272 | 'keepRevisionForever' => array( 273 | 'location' => 'query', 274 | 'type' => 'boolean', 275 | ), 276 | 'ocrLanguage' => array( 277 | 'location' => 'query', 278 | 'type' => 'string', 279 | ), 280 | 'ignoreDefaultVisibility' => array( 281 | 'location' => 'query', 282 | 'type' => 'boolean', 283 | ), 284 | ), 285 | ),'create' => array( 286 | 'path' => 'files', 287 | 'httpMethod' => 'POST', 288 | 'parameters' => array( 289 | 'keepRevisionForever' => array( 290 | 'location' => 'query', 291 | 'type' => 'boolean', 292 | ), 293 | 'useContentAsIndexableText' => array( 294 | 'location' => 'query', 295 | 'type' => 'boolean', 296 | ), 297 | 'ocrLanguage' => array( 298 | 'location' => 'query', 299 | 'type' => 'string', 300 | ), 301 | 'ignoreDefaultVisibility' => array( 302 | 'location' => 'query', 303 | 'type' => 'boolean', 304 | ), 305 | ), 306 | ),'delete' => array( 307 | 'path' => 'files/{fileId}', 308 | 'httpMethod' => 'DELETE', 309 | 'parameters' => array( 310 | 'fileId' => array( 311 | 'location' => 'path', 312 | 'type' => 'string', 313 | 'required' => true, 314 | ), 315 | ), 316 | ),'emptyTrash' => array( 317 | 'path' => 'files/trash', 318 | 'httpMethod' => 'DELETE', 319 | 'parameters' => array(), 320 | ),'export' => array( 321 | 'path' => 'files/{fileId}/export', 322 | 'httpMethod' => 'GET', 323 | 'parameters' => array( 324 | 'fileId' => array( 325 | 'location' => 'path', 326 | 'type' => 'string', 327 | 'required' => true, 328 | ), 329 | 'mimeType' => array( 330 | 'location' => 'query', 331 | 'type' => 'string', 332 | 'required' => true, 333 | ), 334 | ), 335 | ),'generateIds' => array( 336 | 'path' => 'files/generateIds', 337 | 'httpMethod' => 'GET', 338 | 'parameters' => array( 339 | 'count' => array( 340 | 'location' => 'query', 341 | 'type' => 'integer', 342 | ), 343 | 'space' => array( 344 | 'location' => 'query', 345 | 'type' => 'string', 346 | ), 347 | ), 348 | ),'get' => array( 349 | 'path' => 'files/{fileId}', 350 | 'httpMethod' => 'GET', 351 | 'parameters' => array( 352 | 'fileId' => array( 353 | 'location' => 'path', 354 | 'type' => 'string', 355 | 'required' => true, 356 | ), 357 | 'acknowledgeAbuse' => array( 358 | 'location' => 'query', 359 | 'type' => 'boolean', 360 | ), 361 | ), 362 | ),'list' => array( 363 | 'path' => 'files', 364 | 'httpMethod' => 'GET', 365 | 'parameters' => array( 366 | 'orderBy' => array( 367 | 'location' => 'query', 368 | 'type' => 'string', 369 | ), 370 | 'pageSize' => array( 371 | 'location' => 'query', 372 | 'type' => 'integer', 373 | ), 374 | 'q' => array( 375 | 'location' => 'query', 376 | 'type' => 'string', 377 | ), 378 | 'pageToken' => array( 379 | 'location' => 'query', 380 | 'type' => 'string', 381 | ), 382 | 'spaces' => array( 383 | 'location' => 'query', 384 | 'type' => 'string', 385 | ), 386 | 'corpus' => array( 387 | 'location' => 'query', 388 | 'type' => 'string', 389 | ), 390 | ), 391 | ),'update' => array( 392 | 'path' => 'files/{fileId}', 393 | 'httpMethod' => 'PATCH', 394 | 'parameters' => array( 395 | 'fileId' => array( 396 | 'location' => 'path', 397 | 'type' => 'string', 398 | 'required' => true, 399 | ), 400 | 'addParents' => array( 401 | 'location' => 'query', 402 | 'type' => 'string', 403 | ), 404 | 'keepRevisionForever' => array( 405 | 'location' => 'query', 406 | 'type' => 'boolean', 407 | ), 408 | 'useContentAsIndexableText' => array( 409 | 'location' => 'query', 410 | 'type' => 'boolean', 411 | ), 412 | 'ocrLanguage' => array( 413 | 'location' => 'query', 414 | 'type' => 'string', 415 | ), 416 | 'removeParents' => array( 417 | 'location' => 'query', 418 | 'type' => 'string', 419 | ), 420 | ), 421 | ),'watch' => array( 422 | 'path' => 'files/{fileId}/watch', 423 | 'httpMethod' => 'POST', 424 | 'parameters' => array( 425 | 'fileId' => array( 426 | 'location' => 'path', 427 | 'type' => 'string', 428 | 'required' => true, 429 | ), 430 | 'acknowledgeAbuse' => array( 431 | 'location' => 'query', 432 | 'type' => 'boolean', 433 | ), 434 | ), 435 | ), 436 | ) 437 | ) 438 | ); 439 | $this->permissions = new Google_Service_Drive_Permissions_Resource( 440 | $this, 441 | $this->serviceName, 442 | 'permissions', 443 | array( 444 | 'methods' => array( 445 | 'create' => array( 446 | 'path' => 'files/{fileId}/permissions', 447 | 'httpMethod' => 'POST', 448 | 'parameters' => array( 449 | 'fileId' => array( 450 | 'location' => 'path', 451 | 'type' => 'string', 452 | 'required' => true, 453 | ), 454 | 'sendNotificationEmail' => array( 455 | 'location' => 'query', 456 | 'type' => 'boolean', 457 | ), 458 | 'emailMessage' => array( 459 | 'location' => 'query', 460 | 'type' => 'string', 461 | ), 462 | 'transferOwnership' => array( 463 | 'location' => 'query', 464 | 'type' => 'boolean', 465 | ), 466 | ), 467 | ),'delete' => array( 468 | 'path' => 'files/{fileId}/permissions/{permissionId}', 469 | 'httpMethod' => 'DELETE', 470 | 'parameters' => array( 471 | 'fileId' => array( 472 | 'location' => 'path', 473 | 'type' => 'string', 474 | 'required' => true, 475 | ), 476 | 'permissionId' => array( 477 | 'location' => 'path', 478 | 'type' => 'string', 479 | 'required' => true, 480 | ), 481 | ), 482 | ),'get' => array( 483 | 'path' => 'files/{fileId}/permissions/{permissionId}', 484 | 'httpMethod' => 'GET', 485 | 'parameters' => array( 486 | 'fileId' => array( 487 | 'location' => 'path', 488 | 'type' => 'string', 489 | 'required' => true, 490 | ), 491 | 'permissionId' => array( 492 | 'location' => 'path', 493 | 'type' => 'string', 494 | 'required' => true, 495 | ), 496 | ), 497 | ),'list' => array( 498 | 'path' => 'files/{fileId}/permissions', 499 | 'httpMethod' => 'GET', 500 | 'parameters' => array( 501 | 'fileId' => array( 502 | 'location' => 'path', 503 | 'type' => 'string', 504 | 'required' => true, 505 | ), 506 | ), 507 | ),'update' => array( 508 | 'path' => 'files/{fileId}/permissions/{permissionId}', 509 | 'httpMethod' => 'PATCH', 510 | 'parameters' => array( 511 | 'fileId' => array( 512 | 'location' => 'path', 513 | 'type' => 'string', 514 | 'required' => true, 515 | ), 516 | 'permissionId' => array( 517 | 'location' => 'path', 518 | 'type' => 'string', 519 | 'required' => true, 520 | ), 521 | 'transferOwnership' => array( 522 | 'location' => 'query', 523 | 'type' => 'boolean', 524 | ), 525 | ), 526 | ), 527 | ) 528 | ) 529 | ); 530 | $this->replies = new Google_Service_Drive_Replies_Resource( 531 | $this, 532 | $this->serviceName, 533 | 'replies', 534 | array( 535 | 'methods' => array( 536 | 'create' => array( 537 | 'path' => 'files/{fileId}/comments/{commentId}/replies', 538 | 'httpMethod' => 'POST', 539 | 'parameters' => array( 540 | 'fileId' => array( 541 | 'location' => 'path', 542 | 'type' => 'string', 543 | 'required' => true, 544 | ), 545 | 'commentId' => array( 546 | 'location' => 'path', 547 | 'type' => 'string', 548 | 'required' => true, 549 | ), 550 | ), 551 | ),'delete' => array( 552 | 'path' => 'files/{fileId}/comments/{commentId}/replies/{replyId}', 553 | 'httpMethod' => 'DELETE', 554 | 'parameters' => array( 555 | 'fileId' => array( 556 | 'location' => 'path', 557 | 'type' => 'string', 558 | 'required' => true, 559 | ), 560 | 'commentId' => array( 561 | 'location' => 'path', 562 | 'type' => 'string', 563 | 'required' => true, 564 | ), 565 | 'replyId' => array( 566 | 'location' => 'path', 567 | 'type' => 'string', 568 | 'required' => true, 569 | ), 570 | ), 571 | ),'get' => array( 572 | 'path' => 'files/{fileId}/comments/{commentId}/replies/{replyId}', 573 | 'httpMethod' => 'GET', 574 | 'parameters' => array( 575 | 'fileId' => array( 576 | 'location' => 'path', 577 | 'type' => 'string', 578 | 'required' => true, 579 | ), 580 | 'commentId' => array( 581 | 'location' => 'path', 582 | 'type' => 'string', 583 | 'required' => true, 584 | ), 585 | 'replyId' => array( 586 | 'location' => 'path', 587 | 'type' => 'string', 588 | 'required' => true, 589 | ), 590 | 'includeDeleted' => array( 591 | 'location' => 'query', 592 | 'type' => 'boolean', 593 | ), 594 | ), 595 | ),'list' => array( 596 | 'path' => 'files/{fileId}/comments/{commentId}/replies', 597 | 'httpMethod' => 'GET', 598 | 'parameters' => array( 599 | 'fileId' => array( 600 | 'location' => 'path', 601 | 'type' => 'string', 602 | 'required' => true, 603 | ), 604 | 'commentId' => array( 605 | 'location' => 'path', 606 | 'type' => 'string', 607 | 'required' => true, 608 | ), 609 | 'pageToken' => array( 610 | 'location' => 'query', 611 | 'type' => 'string', 612 | ), 613 | 'includeDeleted' => array( 614 | 'location' => 'query', 615 | 'type' => 'boolean', 616 | ), 617 | 'pageSize' => array( 618 | 'location' => 'query', 619 | 'type' => 'integer', 620 | ), 621 | ), 622 | ),'update' => array( 623 | 'path' => 'files/{fileId}/comments/{commentId}/replies/{replyId}', 624 | 'httpMethod' => 'PATCH', 625 | 'parameters' => array( 626 | 'fileId' => array( 627 | 'location' => 'path', 628 | 'type' => 'string', 629 | 'required' => true, 630 | ), 631 | 'commentId' => array( 632 | 'location' => 'path', 633 | 'type' => 'string', 634 | 'required' => true, 635 | ), 636 | 'replyId' => array( 637 | 'location' => 'path', 638 | 'type' => 'string', 639 | 'required' => true, 640 | ), 641 | ), 642 | ), 643 | ) 644 | ) 645 | ); 646 | $this->revisions = new Google_Service_Drive_Revisions_Resource( 647 | $this, 648 | $this->serviceName, 649 | 'revisions', 650 | array( 651 | 'methods' => array( 652 | 'delete' => array( 653 | 'path' => 'files/{fileId}/revisions/{revisionId}', 654 | 'httpMethod' => 'DELETE', 655 | 'parameters' => array( 656 | 'fileId' => array( 657 | 'location' => 'path', 658 | 'type' => 'string', 659 | 'required' => true, 660 | ), 661 | 'revisionId' => array( 662 | 'location' => 'path', 663 | 'type' => 'string', 664 | 'required' => true, 665 | ), 666 | ), 667 | ),'get' => array( 668 | 'path' => 'files/{fileId}/revisions/{revisionId}', 669 | 'httpMethod' => 'GET', 670 | 'parameters' => array( 671 | 'fileId' => array( 672 | 'location' => 'path', 673 | 'type' => 'string', 674 | 'required' => true, 675 | ), 676 | 'revisionId' => array( 677 | 'location' => 'path', 678 | 'type' => 'string', 679 | 'required' => true, 680 | ), 681 | 'acknowledgeAbuse' => array( 682 | 'location' => 'query', 683 | 'type' => 'boolean', 684 | ), 685 | ), 686 | ),'list' => array( 687 | 'path' => 'files/{fileId}/revisions', 688 | 'httpMethod' => 'GET', 689 | 'parameters' => array( 690 | 'fileId' => array( 691 | 'location' => 'path', 692 | 'type' => 'string', 693 | 'required' => true, 694 | ), 695 | ), 696 | ),'update' => array( 697 | 'path' => 'files/{fileId}/revisions/{revisionId}', 698 | 'httpMethod' => 'PATCH', 699 | 'parameters' => array( 700 | 'fileId' => array( 701 | 'location' => 'path', 702 | 'type' => 'string', 703 | 'required' => true, 704 | ), 705 | 'revisionId' => array( 706 | 'location' => 'path', 707 | 'type' => 'string', 708 | 'required' => true, 709 | ), 710 | ), 711 | ), 712 | ) 713 | ) 714 | ); 715 | } 716 | } 717 | 718 | 719 | /** 720 | * The "about" collection of methods. 721 | * Typical usage is: 722 | *
723 | * $driveService = new Google_Service_Drive(...);
724 | * $about = $driveService->about;
725 | *
726 | */
727 | class Google_Service_Drive_About_Resource extends Google_Service_Resource
728 | {
729 |
730 | /**
731 | * Gets information about the user, the user's Drive, and system capabilities.
732 | * (about.get)
733 | *
734 | * @param array $optParams Optional parameters.
735 | * @return Google_Service_Drive_About
736 | */
737 | public function get($optParams = array())
738 | {
739 | $params = array();
740 | $params = array_merge($params, $optParams);
741 | return $this->call('get', array($params), "Google_Service_Drive_About");
742 | }
743 | }
744 |
745 | /**
746 | * The "changes" collection of methods.
747 | * Typical usage is:
748 | *
749 | * $driveService = new Google_Service_Drive(...);
750 | * $changes = $driveService->changes;
751 | *
752 | */
753 | class Google_Service_Drive_Changes_Resource extends Google_Service_Resource
754 | {
755 |
756 | /**
757 | * Gets the starting pageToken for listing future changes.
758 | * (changes.getStartPageToken)
759 | *
760 | * @param array $optParams Optional parameters.
761 | * @return Google_Service_Drive_StartPageToken
762 | */
763 | public function getStartPageToken($optParams = array())
764 | {
765 | $params = array();
766 | $params = array_merge($params, $optParams);
767 | return $this->call('getStartPageToken', array($params), "Google_Service_Drive_StartPageToken");
768 | }
769 |
770 | /**
771 | * Lists changes for a user. (changes.listChanges)
772 | *
773 | * @param string $pageToken The token for continuing a previous list request on
774 | * the next page. This should be set to the value of 'nextPageToken' from the
775 | * previous response or to the response from the getStartPageToken method.
776 | * @param array $optParams Optional parameters.
777 | *
778 | * @opt_param string spaces A comma-separated list of spaces to query within the
779 | * user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
780 | * @opt_param int pageSize The maximum number of changes to return per page.
781 | * @opt_param bool includeRemoved Whether to include changes indicating that
782 | * items have left the view of the changes list, for example by deletion or lost
783 | * access.
784 | * @opt_param bool restrictToMyDrive Whether to restrict the results to changes
785 | * inside the My Drive hierarchy. This omits changes to files such as those in
786 | * the Application Data folder or shared files which have not been added to My
787 | * Drive.
788 | * @return Google_Service_Drive_ChangeList
789 | */
790 | public function listChanges($pageToken, $optParams = array())
791 | {
792 | $params = array('pageToken' => $pageToken);
793 | $params = array_merge($params, $optParams);
794 | return $this->call('list', array($params), "Google_Service_Drive_ChangeList");
795 | }
796 |
797 | /**
798 | * Subscribes to changes for a user. (changes.watch)
799 | *
800 | * @param string $pageToken The token for continuing a previous list request on
801 | * the next page. This should be set to the value of 'nextPageToken' from the
802 | * previous response or to the response from the getStartPageToken method.
803 | * @param Google_Channel $postBody
804 | * @param array $optParams Optional parameters.
805 | *
806 | * @opt_param string spaces A comma-separated list of spaces to query within the
807 | * user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
808 | * @opt_param int pageSize The maximum number of changes to return per page.
809 | * @opt_param bool includeRemoved Whether to include changes indicating that
810 | * items have left the view of the changes list, for example by deletion or lost
811 | * access.
812 | * @opt_param bool restrictToMyDrive Whether to restrict the results to changes
813 | * inside the My Drive hierarchy. This omits changes to files such as those in
814 | * the Application Data folder or shared files which have not been added to My
815 | * Drive.
816 | * @return Google_Service_Drive_Channel
817 | */
818 | public function watch($pageToken, Google_Service_Drive_Channel $postBody, $optParams = array())
819 | {
820 | $params = array('pageToken' => $pageToken, 'postBody' => $postBody);
821 | $params = array_merge($params, $optParams);
822 | return $this->call('watch', array($params), "Google_Service_Drive_Channel");
823 | }
824 | }
825 |
826 | /**
827 | * The "channels" collection of methods.
828 | * Typical usage is:
829 | *
830 | * $driveService = new Google_Service_Drive(...);
831 | * $channels = $driveService->channels;
832 | *
833 | */
834 | class Google_Service_Drive_Channels_Resource extends Google_Service_Resource
835 | {
836 |
837 | /**
838 | * Stop watching resources through this channel (channels.stop)
839 | *
840 | * @param Google_Channel $postBody
841 | * @param array $optParams Optional parameters.
842 | */
843 | public function stop(Google_Service_Drive_Channel $postBody, $optParams = array())
844 | {
845 | $params = array('postBody' => $postBody);
846 | $params = array_merge($params, $optParams);
847 | return $this->call('stop', array($params));
848 | }
849 | }
850 |
851 | /**
852 | * The "comments" collection of methods.
853 | * Typical usage is:
854 | *
855 | * $driveService = new Google_Service_Drive(...);
856 | * $comments = $driveService->comments;
857 | *
858 | */
859 | class Google_Service_Drive_Comments_Resource extends Google_Service_Resource
860 | {
861 |
862 | /**
863 | * Creates a new comment on a file. (comments.create)
864 | *
865 | * @param string $fileId The ID of the file.
866 | * @param Google_Comment $postBody
867 | * @param array $optParams Optional parameters.
868 | * @return Google_Service_Drive_Comment
869 | */
870 | public function create($fileId, Google_Service_Drive_Comment $postBody, $optParams = array())
871 | {
872 | $params = array('fileId' => $fileId, 'postBody' => $postBody);
873 | $params = array_merge($params, $optParams);
874 | return $this->call('create', array($params), "Google_Service_Drive_Comment");
875 | }
876 |
877 | /**
878 | * Deletes a comment. (comments.delete)
879 | *
880 | * @param string $fileId The ID of the file.
881 | * @param string $commentId The ID of the comment.
882 | * @param array $optParams Optional parameters.
883 | */
884 | public function delete($fileId, $commentId, $optParams = array())
885 | {
886 | $params = array('fileId' => $fileId, 'commentId' => $commentId);
887 | $params = array_merge($params, $optParams);
888 | return $this->call('delete', array($params));
889 | }
890 |
891 | /**
892 | * Gets a comment by ID. (comments.get)
893 | *
894 | * @param string $fileId The ID of the file.
895 | * @param string $commentId The ID of the comment.
896 | * @param array $optParams Optional parameters.
897 | *
898 | * @opt_param bool includeDeleted Whether to return deleted comments. Deleted
899 | * comments will not include their original content.
900 | * @return Google_Service_Drive_Comment
901 | */
902 | public function get($fileId, $commentId, $optParams = array())
903 | {
904 | $params = array('fileId' => $fileId, 'commentId' => $commentId);
905 | $params = array_merge($params, $optParams);
906 | return $this->call('get', array($params), "Google_Service_Drive_Comment");
907 | }
908 |
909 | /**
910 | * Lists a file's comments. (comments.listComments)
911 | *
912 | * @param string $fileId The ID of the file.
913 | * @param array $optParams Optional parameters.
914 | *
915 | * @opt_param string pageToken The token for continuing a previous list request
916 | * on the next page. This should be set to the value of 'nextPageToken' from the
917 | * previous response.
918 | * @opt_param string startModifiedTime The minimum value of 'modifiedTime' for
919 | * the result comments (RFC 3339 date-time).
920 | * @opt_param bool includeDeleted Whether to include deleted comments. Deleted
921 | * comments will not include their original content.
922 | * @opt_param int pageSize The maximum number of comments to return per page.
923 | * @return Google_Service_Drive_CommentList
924 | */
925 | public function listComments($fileId, $optParams = array())
926 | {
927 | $params = array('fileId' => $fileId);
928 | $params = array_merge($params, $optParams);
929 | return $this->call('list', array($params), "Google_Service_Drive_CommentList");
930 | }
931 |
932 | /**
933 | * Updates a comment with patch semantics. (comments.update)
934 | *
935 | * @param string $fileId The ID of the file.
936 | * @param string $commentId The ID of the comment.
937 | * @param Google_Comment $postBody
938 | * @param array $optParams Optional parameters.
939 | * @return Google_Service_Drive_Comment
940 | */
941 | public function update($fileId, $commentId, Google_Service_Drive_Comment $postBody, $optParams = array())
942 | {
943 | $params = array('fileId' => $fileId, 'commentId' => $commentId, 'postBody' => $postBody);
944 | $params = array_merge($params, $optParams);
945 | return $this->call('update', array($params), "Google_Service_Drive_Comment");
946 | }
947 | }
948 |
949 | /**
950 | * The "files" collection of methods.
951 | * Typical usage is:
952 | *
953 | * $driveService = new Google_Service_Drive(...);
954 | * $files = $driveService->files;
955 | *
956 | */
957 | class Google_Service_Drive_Files_Resource extends Google_Service_Resource
958 | {
959 |
960 | /**
961 | * Creates a copy of a file and applies any requested updates with patch
962 | * semantics. (files.copy)
963 | *
964 | * @param string $fileId The ID of the file.
965 | * @param Google_DriveFile $postBody
966 | * @param array $optParams Optional parameters.
967 | *
968 | * @opt_param bool keepRevisionForever Whether to set the 'keepForever' field in
969 | * the new head revision. This is only applicable to files with binary content
970 | * in Drive.
971 | * @opt_param string ocrLanguage A language hint for OCR processing during image
972 | * import (ISO 639-1 code).
973 | * @opt_param bool ignoreDefaultVisibility Whether to ignore the domain's
974 | * default visibility settings for the created file. Domain administrators can
975 | * choose to make all uploaded files visible to the domain by default; this
976 | * parameter bypasses that behavior for the request. Permissions are still
977 | * inherited from parent folders.
978 | * @return Google_Service_Drive_DriveFile
979 | */
980 | public function copy($fileId, Google_Service_Drive_DriveFile $postBody, $optParams = array())
981 | {
982 | $params = array('fileId' => $fileId, 'postBody' => $postBody);
983 | $params = array_merge($params, $optParams);
984 | return $this->call('copy', array($params), "Google_Service_Drive_DriveFile");
985 | }
986 |
987 | /**
988 | * Creates a new file. (files.create)
989 | *
990 | * @param Google_DriveFile $postBody
991 | * @param array $optParams Optional parameters.
992 | *
993 | * @opt_param bool keepRevisionForever Whether to set the 'keepForever' field in
994 | * the new head revision. This is only applicable to files with binary content
995 | * in Drive.
996 | * @opt_param bool useContentAsIndexableText Whether to use the uploaded content
997 | * as indexable text.
998 | * @opt_param string ocrLanguage A language hint for OCR processing during image
999 | * import (ISO 639-1 code).
1000 | * @opt_param bool ignoreDefaultVisibility Whether to ignore the domain's
1001 | * default visibility settings for the created file. Domain administrators can
1002 | * choose to make all uploaded files visible to the domain by default; this
1003 | * parameter bypasses that behavior for the request. Permissions are still
1004 | * inherited from parent folders.
1005 | * @return Google_Service_Drive_DriveFile
1006 | */
1007 | public function create(Google_Service_Drive_DriveFile $postBody, $optParams = array())
1008 | {
1009 | $params = array('postBody' => $postBody);
1010 | $params = array_merge($params, $optParams);
1011 | return $this->call('create', array($params), "Google_Service_Drive_DriveFile");
1012 | }
1013 |
1014 | /**
1015 | * Permanently deletes a file owned by the user without moving it to the trash.
1016 | * If the target is a folder, all descendants owned by the user are also
1017 | * deleted. (files.delete)
1018 | *
1019 | * @param string $fileId The ID of the file.
1020 | * @param array $optParams Optional parameters.
1021 | */
1022 | public function delete($fileId, $optParams = array())
1023 | {
1024 | $params = array('fileId' => $fileId);
1025 | $params = array_merge($params, $optParams);
1026 | return $this->call('delete', array($params));
1027 | }
1028 |
1029 | /**
1030 | * Permanently deletes all of the user's trashed files. (files.emptyTrash)
1031 | *
1032 | * @param array $optParams Optional parameters.
1033 | */
1034 | public function emptyTrash($optParams = array())
1035 | {
1036 | $params = array();
1037 | $params = array_merge($params, $optParams);
1038 | return $this->call('emptyTrash', array($params));
1039 | }
1040 |
1041 | /**
1042 | * Exports a Google Doc to the requested MIME type. (files.export)
1043 | *
1044 | * @param string $fileId The ID of the file.
1045 | * @param string $mimeType The MIME type of the format requested for this
1046 | * export.
1047 | * @param array $optParams Optional parameters.
1048 | */
1049 | public function export($fileId, $mimeType, $optParams = array())
1050 | {
1051 | $params = array('fileId' => $fileId, 'mimeType' => $mimeType);
1052 | $params = array_merge($params, $optParams);
1053 | return $this->call('export', array($params));
1054 | }
1055 |
1056 | /**
1057 | * Generates a set of file IDs which can be provided in create requests.
1058 | * (files.generateIds)
1059 | *
1060 | * @param array $optParams Optional parameters.
1061 | *
1062 | * @opt_param int count The number of IDs to return.
1063 | * @opt_param string space The space in which the IDs can be used to create new
1064 | * files. Supported values are 'drive' and 'appDataFolder'.
1065 | * @return Google_Service_Drive_GeneratedIds
1066 | */
1067 | public function generateIds($optParams = array())
1068 | {
1069 | $params = array();
1070 | $params = array_merge($params, $optParams);
1071 | return $this->call('generateIds', array($params), "Google_Service_Drive_GeneratedIds");
1072 | }
1073 |
1074 | /**
1075 | * Gets a file's metadata or content by ID. (files.get)
1076 | *
1077 | * @param string $fileId The ID of the file.
1078 | * @param array $optParams Optional parameters.
1079 | *
1080 | * @opt_param bool acknowledgeAbuse Whether the user is acknowledging the risk
1081 | * of downloading known malware or other abusive files. This is only applicable
1082 | * when alt=media.
1083 | * @return Google_Service_Drive_DriveFile
1084 | */
1085 | public function get($fileId, $optParams = array())
1086 | {
1087 | $params = array('fileId' => $fileId);
1088 | $params = array_merge($params, $optParams);
1089 | return $this->call('get', array($params), "Google_Service_Drive_DriveFile");
1090 | }
1091 |
1092 | /**
1093 | * Lists or searches files. (files.listFiles)
1094 | *
1095 | * @param array $optParams Optional parameters.
1096 | *
1097 | * @opt_param string orderBy A comma-separated list of sort keys. Valid keys are
1098 | * 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name',
1099 | * 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and
1100 | * 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed
1101 | * with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime
1102 | * desc,name. Please note that there is a current limitation for users with
1103 | * approximately one million files in which the requested sort order is ignored.
1104 | * @opt_param int pageSize The maximum number of files to return per page.
1105 | * @opt_param string q A query for filtering the file results. See the "Search
1106 | * for Files" guide for supported syntax.
1107 | * @opt_param string pageToken The token for continuing a previous list request
1108 | * on the next page. This should be set to the value of 'nextPageToken' from the
1109 | * previous response.
1110 | * @opt_param string spaces A comma-separated list of spaces to query within the
1111 | * corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
1112 | * @opt_param string corpus The source of files to list.
1113 | * @return Google_Service_Drive_FileList
1114 | */
1115 | public function listFiles($optParams = array())
1116 | {
1117 | $params = array();
1118 | $params = array_merge($params, $optParams);
1119 | return $this->call('list', array($params), "Google_Service_Drive_FileList");
1120 | }
1121 |
1122 | /**
1123 | * Updates a file's metadata and/or content with patch semantics. (files.update)
1124 | *
1125 | * @param string $fileId The ID of the file.
1126 | * @param Google_DriveFile $postBody
1127 | * @param array $optParams Optional parameters.
1128 | *
1129 | * @opt_param string addParents A comma-separated list of parent IDs to add.
1130 | * @opt_param bool keepRevisionForever Whether to set the 'keepForever' field in
1131 | * the new head revision. This is only applicable to files with binary content
1132 | * in Drive.
1133 | * @opt_param bool useContentAsIndexableText Whether to use the uploaded content
1134 | * as indexable text.
1135 | * @opt_param string ocrLanguage A language hint for OCR processing during image
1136 | * import (ISO 639-1 code).
1137 | * @opt_param string removeParents A comma-separated list of parent IDs to
1138 | * remove.
1139 | * @return Google_Service_Drive_DriveFile
1140 | */
1141 | public function update($fileId, Google_Service_Drive_DriveFile $postBody, $optParams = array())
1142 | {
1143 | $params = array('fileId' => $fileId, 'postBody' => $postBody);
1144 | $params = array_merge($params, $optParams);
1145 | return $this->call('update', array($params), "Google_Service_Drive_DriveFile");
1146 | }
1147 |
1148 | /**
1149 | * Subscribes to changes to a file (files.watch)
1150 | *
1151 | * @param string $fileId The ID of the file.
1152 | * @param Google_Channel $postBody
1153 | * @param array $optParams Optional parameters.
1154 | *
1155 | * @opt_param bool acknowledgeAbuse Whether the user is acknowledging the risk
1156 | * of downloading known malware or other abusive files. This is only applicable
1157 | * when alt=media.
1158 | * @return Google_Service_Drive_Channel
1159 | */
1160 | public function watch($fileId, Google_Service_Drive_Channel $postBody, $optParams = array())
1161 | {
1162 | $params = array('fileId' => $fileId, 'postBody' => $postBody);
1163 | $params = array_merge($params, $optParams);
1164 | return $this->call('watch', array($params), "Google_Service_Drive_Channel");
1165 | }
1166 | }
1167 |
1168 | /**
1169 | * The "permissions" collection of methods.
1170 | * Typical usage is:
1171 | *
1172 | * $driveService = new Google_Service_Drive(...);
1173 | * $permissions = $driveService->permissions;
1174 | *
1175 | */
1176 | class Google_Service_Drive_Permissions_Resource extends Google_Service_Resource
1177 | {
1178 |
1179 | /**
1180 | * Creates a permission for a file. (permissions.create)
1181 | *
1182 | * @param string $fileId The ID of the file.
1183 | * @param Google_Permission $postBody
1184 | * @param array $optParams Optional parameters.
1185 | *
1186 | * @opt_param bool sendNotificationEmail Whether to send a notification email
1187 | * when sharing to users or groups. This defaults to true for users and groups,
1188 | * and is not allowed for other requests. It must not be disabled for ownership
1189 | * transfers.
1190 | * @opt_param string emailMessage A custom message to include in the
1191 | * notification email.
1192 | * @opt_param bool transferOwnership Whether to transfer ownership to the
1193 | * specified user and downgrade the current owner to a writer. This parameter is
1194 | * required as an acknowledgement of the side effect.
1195 | * @return Google_Service_Drive_Permission
1196 | */
1197 | public function create($fileId, Google_Service_Drive_Permission $postBody, $optParams = array())
1198 | {
1199 | $params = array('fileId' => $fileId, 'postBody' => $postBody);
1200 | $params = array_merge($params, $optParams);
1201 | return $this->call('create', array($params), "Google_Service_Drive_Permission");
1202 | }
1203 |
1204 | /**
1205 | * Deletes a permission. (permissions.delete)
1206 | *
1207 | * @param string $fileId The ID of the file.
1208 | * @param string $permissionId The ID of the permission.
1209 | * @param array $optParams Optional parameters.
1210 | */
1211 | public function delete($fileId, $permissionId, $optParams = array())
1212 | {
1213 | $params = array('fileId' => $fileId, 'permissionId' => $permissionId);
1214 | $params = array_merge($params, $optParams);
1215 | return $this->call('delete', array($params));
1216 | }
1217 |
1218 | /**
1219 | * Gets a permission by ID. (permissions.get)
1220 | *
1221 | * @param string $fileId The ID of the file.
1222 | * @param string $permissionId The ID of the permission.
1223 | * @param array $optParams Optional parameters.
1224 | * @return Google_Service_Drive_Permission
1225 | */
1226 | public function get($fileId, $permissionId, $optParams = array())
1227 | {
1228 | $params = array('fileId' => $fileId, 'permissionId' => $permissionId);
1229 | $params = array_merge($params, $optParams);
1230 | return $this->call('get', array($params), "Google_Service_Drive_Permission");
1231 | }
1232 |
1233 | /**
1234 | * Lists a file's permissions. (permissions.listPermissions)
1235 | *
1236 | * @param string $fileId The ID of the file.
1237 | * @param array $optParams Optional parameters.
1238 | * @return Google_Service_Drive_PermissionList
1239 | */
1240 | public function listPermissions($fileId, $optParams = array())
1241 | {
1242 | $params = array('fileId' => $fileId);
1243 | $params = array_merge($params, $optParams);
1244 | return $this->call('list', array($params), "Google_Service_Drive_PermissionList");
1245 | }
1246 |
1247 | /**
1248 | * Updates a permission with patch semantics. (permissions.update)
1249 | *
1250 | * @param string $fileId The ID of the file.
1251 | * @param string $permissionId The ID of the permission.
1252 | * @param Google_Permission $postBody
1253 | * @param array $optParams Optional parameters.
1254 | *
1255 | * @opt_param bool transferOwnership Whether to transfer ownership to the
1256 | * specified user and downgrade the current owner to a writer. This parameter is
1257 | * required as an acknowledgement of the side effect.
1258 | * @return Google_Service_Drive_Permission
1259 | */
1260 | public function update($fileId, $permissionId, Google_Service_Drive_Permission $postBody, $optParams = array())
1261 | {
1262 | $params = array('fileId' => $fileId, 'permissionId' => $permissionId, 'postBody' => $postBody);
1263 | $params = array_merge($params, $optParams);
1264 | return $this->call('update', array($params), "Google_Service_Drive_Permission");
1265 | }
1266 | }
1267 |
1268 | /**
1269 | * The "replies" collection of methods.
1270 | * Typical usage is:
1271 | *
1272 | * $driveService = new Google_Service_Drive(...);
1273 | * $replies = $driveService->replies;
1274 | *
1275 | */
1276 | class Google_Service_Drive_Replies_Resource extends Google_Service_Resource
1277 | {
1278 |
1279 | /**
1280 | * Creates a new reply to a comment. (replies.create)
1281 | *
1282 | * @param string $fileId The ID of the file.
1283 | * @param string $commentId The ID of the comment.
1284 | * @param Google_Reply $postBody
1285 | * @param array $optParams Optional parameters.
1286 | * @return Google_Service_Drive_Reply
1287 | */
1288 | public function create($fileId, $commentId, Google_Service_Drive_Reply $postBody, $optParams = array())
1289 | {
1290 | $params = array('fileId' => $fileId, 'commentId' => $commentId, 'postBody' => $postBody);
1291 | $params = array_merge($params, $optParams);
1292 | return $this->call('create', array($params), "Google_Service_Drive_Reply");
1293 | }
1294 |
1295 | /**
1296 | * Deletes a reply. (replies.delete)
1297 | *
1298 | * @param string $fileId The ID of the file.
1299 | * @param string $commentId The ID of the comment.
1300 | * @param string $replyId The ID of the reply.
1301 | * @param array $optParams Optional parameters.
1302 | */
1303 | public function delete($fileId, $commentId, $replyId, $optParams = array())
1304 | {
1305 | $params = array('fileId' => $fileId, 'commentId' => $commentId, 'replyId' => $replyId);
1306 | $params = array_merge($params, $optParams);
1307 | return $this->call('delete', array($params));
1308 | }
1309 |
1310 | /**
1311 | * Gets a reply by ID. (replies.get)
1312 | *
1313 | * @param string $fileId The ID of the file.
1314 | * @param string $commentId The ID of the comment.
1315 | * @param string $replyId The ID of the reply.
1316 | * @param array $optParams Optional parameters.
1317 | *
1318 | * @opt_param bool includeDeleted Whether to return deleted replies. Deleted
1319 | * replies will not include their original content.
1320 | * @return Google_Service_Drive_Reply
1321 | */
1322 | public function get($fileId, $commentId, $replyId, $optParams = array())
1323 | {
1324 | $params = array('fileId' => $fileId, 'commentId' => $commentId, 'replyId' => $replyId);
1325 | $params = array_merge($params, $optParams);
1326 | return $this->call('get', array($params), "Google_Service_Drive_Reply");
1327 | }
1328 |
1329 | /**
1330 | * Lists a comment's replies. (replies.listReplies)
1331 | *
1332 | * @param string $fileId The ID of the file.
1333 | * @param string $commentId The ID of the comment.
1334 | * @param array $optParams Optional parameters.
1335 | *
1336 | * @opt_param string pageToken The token for continuing a previous list request
1337 | * on the next page. This should be set to the value of 'nextPageToken' from the
1338 | * previous response.
1339 | * @opt_param bool includeDeleted Whether to include deleted replies. Deleted
1340 | * replies will not include their original content.
1341 | * @opt_param int pageSize The maximum number of replies to return per page.
1342 | * @return Google_Service_Drive_ReplyList
1343 | */
1344 | public function listReplies($fileId, $commentId, $optParams = array())
1345 | {
1346 | $params = array('fileId' => $fileId, 'commentId' => $commentId);
1347 | $params = array_merge($params, $optParams);
1348 | return $this->call('list', array($params), "Google_Service_Drive_ReplyList");
1349 | }
1350 |
1351 | /**
1352 | * Updates a reply with patch semantics. (replies.update)
1353 | *
1354 | * @param string $fileId The ID of the file.
1355 | * @param string $commentId The ID of the comment.
1356 | * @param string $replyId The ID of the reply.
1357 | * @param Google_Reply $postBody
1358 | * @param array $optParams Optional parameters.
1359 | * @return Google_Service_Drive_Reply
1360 | */
1361 | public function update($fileId, $commentId, $replyId, Google_Service_Drive_Reply $postBody, $optParams = array())
1362 | {
1363 | $params = array('fileId' => $fileId, 'commentId' => $commentId, 'replyId' => $replyId, 'postBody' => $postBody);
1364 | $params = array_merge($params, $optParams);
1365 | return $this->call('update', array($params), "Google_Service_Drive_Reply");
1366 | }
1367 | }
1368 |
1369 | /**
1370 | * The "revisions" collection of methods.
1371 | * Typical usage is:
1372 | *
1373 | * $driveService = new Google_Service_Drive(...);
1374 | * $revisions = $driveService->revisions;
1375 | *
1376 | */
1377 | class Google_Service_Drive_Revisions_Resource extends Google_Service_Resource
1378 | {
1379 |
1380 | /**
1381 | * Permanently deletes a revision. This method is only applicable to files with
1382 | * binary content in Drive. (revisions.delete)
1383 | *
1384 | * @param string $fileId The ID of the file.
1385 | * @param string $revisionId The ID of the revision.
1386 | * @param array $optParams Optional parameters.
1387 | */
1388 | public function delete($fileId, $revisionId, $optParams = array())
1389 | {
1390 | $params = array('fileId' => $fileId, 'revisionId' => $revisionId);
1391 | $params = array_merge($params, $optParams);
1392 | return $this->call('delete', array($params));
1393 | }
1394 |
1395 | /**
1396 | * Gets a revision's metadata or content by ID. (revisions.get)
1397 | *
1398 | * @param string $fileId The ID of the file.
1399 | * @param string $revisionId The ID of the revision.
1400 | * @param array $optParams Optional parameters.
1401 | *
1402 | * @opt_param bool acknowledgeAbuse Whether the user is acknowledging the risk
1403 | * of downloading known malware or other abusive files. This is only applicable
1404 | * when alt=media.
1405 | * @return Google_Service_Drive_Revision
1406 | */
1407 | public function get($fileId, $revisionId, $optParams = array())
1408 | {
1409 | $params = array('fileId' => $fileId, 'revisionId' => $revisionId);
1410 | $params = array_merge($params, $optParams);
1411 | return $this->call('get', array($params), "Google_Service_Drive_Revision");
1412 | }
1413 |
1414 | /**
1415 | * Lists a file's revisions. (revisions.listRevisions)
1416 | *
1417 | * @param string $fileId The ID of the file.
1418 | * @param array $optParams Optional parameters.
1419 | * @return Google_Service_Drive_RevisionList
1420 | */
1421 | public function listRevisions($fileId, $optParams = array())
1422 | {
1423 | $params = array('fileId' => $fileId);
1424 | $params = array_merge($params, $optParams);
1425 | return $this->call('list', array($params), "Google_Service_Drive_RevisionList");
1426 | }
1427 |
1428 | /**
1429 | * Updates a revision with patch semantics. (revisions.update)
1430 | *
1431 | * @param string $fileId The ID of the file.
1432 | * @param string $revisionId The ID of the revision.
1433 | * @param Google_Revision $postBody
1434 | * @param array $optParams Optional parameters.
1435 | * @return Google_Service_Drive_Revision
1436 | */
1437 | public function update($fileId, $revisionId, Google_Service_Drive_Revision $postBody, $optParams = array())
1438 | {
1439 | $params = array('fileId' => $fileId, 'revisionId' => $revisionId, 'postBody' => $postBody);
1440 | $params = array_merge($params, $optParams);
1441 | return $this->call('update', array($params), "Google_Service_Drive_Revision");
1442 | }
1443 | }
1444 |
1445 |
1446 |
1447 |
1448 | class Google_Service_Drive_About extends Google_Collection
1449 | {
1450 | protected $collection_key = 'folderColorPalette';
1451 | protected $internal_gapi_mappings = array(
1452 | );
1453 | public $appInstalled;
1454 | public $exportFormats;
1455 | public $folderColorPalette;
1456 | public $importFormats;
1457 | public $kind;
1458 | public $maxImportSizes;
1459 | public $maxUploadSize;
1460 | protected $storageQuotaType = 'Google_Service_Drive_AboutStorageQuota';
1461 | protected $storageQuotaDataType = '';
1462 | protected $userType = 'Google_Service_Drive_User';
1463 | protected $userDataType = '';
1464 |
1465 |
1466 | public function setAppInstalled($appInstalled)
1467 | {
1468 | $this->appInstalled = $appInstalled;
1469 | }
1470 | public function getAppInstalled()
1471 | {
1472 | return $this->appInstalled;
1473 | }
1474 | public function setExportFormats($exportFormats)
1475 | {
1476 | $this->exportFormats = $exportFormats;
1477 | }
1478 | public function getExportFormats()
1479 | {
1480 | return $this->exportFormats;
1481 | }
1482 | public function setFolderColorPalette($folderColorPalette)
1483 | {
1484 | $this->folderColorPalette = $folderColorPalette;
1485 | }
1486 | public function getFolderColorPalette()
1487 | {
1488 | return $this->folderColorPalette;
1489 | }
1490 | public function setImportFormats($importFormats)
1491 | {
1492 | $this->importFormats = $importFormats;
1493 | }
1494 | public function getImportFormats()
1495 | {
1496 | return $this->importFormats;
1497 | }
1498 | public function setKind($kind)
1499 | {
1500 | $this->kind = $kind;
1501 | }
1502 | public function getKind()
1503 | {
1504 | return $this->kind;
1505 | }
1506 | public function setMaxImportSizes($maxImportSizes)
1507 | {
1508 | $this->maxImportSizes = $maxImportSizes;
1509 | }
1510 | public function getMaxImportSizes()
1511 | {
1512 | return $this->maxImportSizes;
1513 | }
1514 | public function setMaxUploadSize($maxUploadSize)
1515 | {
1516 | $this->maxUploadSize = $maxUploadSize;
1517 | }
1518 | public function getMaxUploadSize()
1519 | {
1520 | return $this->maxUploadSize;
1521 | }
1522 | public function setStorageQuota(Google_Service_Drive_AboutStorageQuota $storageQuota)
1523 | {
1524 | $this->storageQuota = $storageQuota;
1525 | }
1526 | public function getStorageQuota()
1527 | {
1528 | return $this->storageQuota;
1529 | }
1530 | public function setUser(Google_Service_Drive_User $user)
1531 | {
1532 | $this->user = $user;
1533 | }
1534 | public function getUser()
1535 | {
1536 | return $this->user;
1537 | }
1538 | }
1539 |
1540 | class Google_Service_Drive_AboutExportFormats extends Google_Model
1541 | {
1542 | }
1543 |
1544 | class Google_Service_Drive_AboutImportFormats extends Google_Model
1545 | {
1546 | }
1547 |
1548 | class Google_Service_Drive_AboutMaxImportSizes extends Google_Model
1549 | {
1550 | }
1551 |
1552 | class Google_Service_Drive_AboutStorageQuota extends Google_Model
1553 | {
1554 | protected $internal_gapi_mappings = array(
1555 | );
1556 | public $limit;
1557 | public $usage;
1558 | public $usageInDrive;
1559 | public $usageInDriveTrash;
1560 |
1561 |
1562 | public function setLimit($limit)
1563 | {
1564 | $this->limit = $limit;
1565 | }
1566 | public function getLimit()
1567 | {
1568 | return $this->limit;
1569 | }
1570 | public function setUsage($usage)
1571 | {
1572 | $this->usage = $usage;
1573 | }
1574 | public function getUsage()
1575 | {
1576 | return $this->usage;
1577 | }
1578 | public function setUsageInDrive($usageInDrive)
1579 | {
1580 | $this->usageInDrive = $usageInDrive;
1581 | }
1582 | public function getUsageInDrive()
1583 | {
1584 | return $this->usageInDrive;
1585 | }
1586 | public function setUsageInDriveTrash($usageInDriveTrash)
1587 | {
1588 | $this->usageInDriveTrash = $usageInDriveTrash;
1589 | }
1590 | public function getUsageInDriveTrash()
1591 | {
1592 | return $this->usageInDriveTrash;
1593 | }
1594 | }
1595 |
1596 | class Google_Service_Drive_Change extends Google_Model
1597 | {
1598 | protected $internal_gapi_mappings = array(
1599 | );
1600 | protected $fileType = 'Google_Service_Drive_DriveFile';
1601 | protected $fileDataType = '';
1602 | public $fileId;
1603 | public $kind;
1604 | public $removed;
1605 | public $time;
1606 |
1607 |
1608 | public function setFile(Google_Service_Drive_DriveFile $file)
1609 | {
1610 | $this->file = $file;
1611 | }
1612 | public function getFile()
1613 | {
1614 | return $this->file;
1615 | }
1616 | public function setFileId($fileId)
1617 | {
1618 | $this->fileId = $fileId;
1619 | }
1620 | public function getFileId()
1621 | {
1622 | return $this->fileId;
1623 | }
1624 | public function setKind($kind)
1625 | {
1626 | $this->kind = $kind;
1627 | }
1628 | public function getKind()
1629 | {
1630 | return $this->kind;
1631 | }
1632 | public function setRemoved($removed)
1633 | {
1634 | $this->removed = $removed;
1635 | }
1636 | public function getRemoved()
1637 | {
1638 | return $this->removed;
1639 | }
1640 | public function setTime($time)
1641 | {
1642 | $this->time = $time;
1643 | }
1644 | public function getTime()
1645 | {
1646 | return $this->time;
1647 | }
1648 | }
1649 |
1650 | class Google_Service_Drive_ChangeList extends Google_Collection
1651 | {
1652 | protected $collection_key = 'changes';
1653 | protected $internal_gapi_mappings = array(
1654 | );
1655 | protected $changesType = 'Google_Service_Drive_Change';
1656 | protected $changesDataType = 'array';
1657 | public $kind;
1658 | public $newStartPageToken;
1659 | public $nextPageToken;
1660 |
1661 |
1662 | public function setChanges($changes)
1663 | {
1664 | $this->changes = $changes;
1665 | }
1666 | public function getChanges()
1667 | {
1668 | return $this->changes;
1669 | }
1670 | public function setKind($kind)
1671 | {
1672 | $this->kind = $kind;
1673 | }
1674 | public function getKind()
1675 | {
1676 | return $this->kind;
1677 | }
1678 | public function setNewStartPageToken($newStartPageToken)
1679 | {
1680 | $this->newStartPageToken = $newStartPageToken;
1681 | }
1682 | public function getNewStartPageToken()
1683 | {
1684 | return $this->newStartPageToken;
1685 | }
1686 | public function setNextPageToken($nextPageToken)
1687 | {
1688 | $this->nextPageToken = $nextPageToken;
1689 | }
1690 | public function getNextPageToken()
1691 | {
1692 | return $this->nextPageToken;
1693 | }
1694 | }
1695 |
1696 | class Google_Service_Drive_Channel extends Google_Model
1697 | {
1698 | protected $internal_gapi_mappings = array(
1699 | );
1700 | public $address;
1701 | public $expiration;
1702 | public $id;
1703 | public $kind;
1704 | public $params;
1705 | public $payload;
1706 | public $resourceId;
1707 | public $resourceUri;
1708 | public $token;
1709 | public $type;
1710 |
1711 |
1712 | public function setAddress($address)
1713 | {
1714 | $this->address = $address;
1715 | }
1716 | public function getAddress()
1717 | {
1718 | return $this->address;
1719 | }
1720 | public function setExpiration($expiration)
1721 | {
1722 | $this->expiration = $expiration;
1723 | }
1724 | public function getExpiration()
1725 | {
1726 | return $this->expiration;
1727 | }
1728 | public function setId($id)
1729 | {
1730 | $this->id = $id;
1731 | }
1732 | public function getId()
1733 | {
1734 | return $this->id;
1735 | }
1736 | public function setKind($kind)
1737 | {
1738 | $this->kind = $kind;
1739 | }
1740 | public function getKind()
1741 | {
1742 | return $this->kind;
1743 | }
1744 | public function setParams($params)
1745 | {
1746 | $this->params = $params;
1747 | }
1748 | public function getParams()
1749 | {
1750 | return $this->params;
1751 | }
1752 | public function setPayload($payload)
1753 | {
1754 | $this->payload = $payload;
1755 | }
1756 | public function getPayload()
1757 | {
1758 | return $this->payload;
1759 | }
1760 | public function setResourceId($resourceId)
1761 | {
1762 | $this->resourceId = $resourceId;
1763 | }
1764 | public function getResourceId()
1765 | {
1766 | return $this->resourceId;
1767 | }
1768 | public function setResourceUri($resourceUri)
1769 | {
1770 | $this->resourceUri = $resourceUri;
1771 | }
1772 | public function getResourceUri()
1773 | {
1774 | return $this->resourceUri;
1775 | }
1776 | public function setToken($token)
1777 | {
1778 | $this->token = $token;
1779 | }
1780 | public function getToken()
1781 | {
1782 | return $this->token;
1783 | }
1784 | public function setType($type)
1785 | {
1786 | $this->type = $type;
1787 | }
1788 | public function getType()
1789 | {
1790 | return $this->type;
1791 | }
1792 | }
1793 |
1794 | class Google_Service_Drive_ChannelParams extends Google_Model
1795 | {
1796 | }
1797 |
1798 | class Google_Service_Drive_Comment extends Google_Collection
1799 | {
1800 | protected $collection_key = 'replies';
1801 | protected $internal_gapi_mappings = array(
1802 | );
1803 | public $anchor;
1804 | protected $authorType = 'Google_Service_Drive_User';
1805 | protected $authorDataType = '';
1806 | public $content;
1807 | public $createdTime;
1808 | public $deleted;
1809 | public $htmlContent;
1810 | public $id;
1811 | public $kind;
1812 | public $modifiedTime;
1813 | protected $quotedFileContentType = 'Google_Service_Drive_CommentQuotedFileContent';
1814 | protected $quotedFileContentDataType = '';
1815 | protected $repliesType = 'Google_Service_Drive_Reply';
1816 | protected $repliesDataType = 'array';
1817 | public $resolved;
1818 |
1819 |
1820 | public function setAnchor($anchor)
1821 | {
1822 | $this->anchor = $anchor;
1823 | }
1824 | public function getAnchor()
1825 | {
1826 | return $this->anchor;
1827 | }
1828 | public function setAuthor(Google_Service_Drive_User $author)
1829 | {
1830 | $this->author = $author;
1831 | }
1832 | public function getAuthor()
1833 | {
1834 | return $this->author;
1835 | }
1836 | public function setContent($content)
1837 | {
1838 | $this->content = $content;
1839 | }
1840 | public function getContent()
1841 | {
1842 | return $this->content;
1843 | }
1844 | public function setCreatedTime($createdTime)
1845 | {
1846 | $this->createdTime = $createdTime;
1847 | }
1848 | public function getCreatedTime()
1849 | {
1850 | return $this->createdTime;
1851 | }
1852 | public function setDeleted($deleted)
1853 | {
1854 | $this->deleted = $deleted;
1855 | }
1856 | public function getDeleted()
1857 | {
1858 | return $this->deleted;
1859 | }
1860 | public function setHtmlContent($htmlContent)
1861 | {
1862 | $this->htmlContent = $htmlContent;
1863 | }
1864 | public function getHtmlContent()
1865 | {
1866 | return $this->htmlContent;
1867 | }
1868 | public function setId($id)
1869 | {
1870 | $this->id = $id;
1871 | }
1872 | public function getId()
1873 | {
1874 | return $this->id;
1875 | }
1876 | public function setKind($kind)
1877 | {
1878 | $this->kind = $kind;
1879 | }
1880 | public function getKind()
1881 | {
1882 | return $this->kind;
1883 | }
1884 | public function setModifiedTime($modifiedTime)
1885 | {
1886 | $this->modifiedTime = $modifiedTime;
1887 | }
1888 | public function getModifiedTime()
1889 | {
1890 | return $this->modifiedTime;
1891 | }
1892 | public function setQuotedFileContent(Google_Service_Drive_CommentQuotedFileContent $quotedFileContent)
1893 | {
1894 | $this->quotedFileContent = $quotedFileContent;
1895 | }
1896 | public function getQuotedFileContent()
1897 | {
1898 | return $this->quotedFileContent;
1899 | }
1900 | public function setReplies($replies)
1901 | {
1902 | $this->replies = $replies;
1903 | }
1904 | public function getReplies()
1905 | {
1906 | return $this->replies;
1907 | }
1908 | public function setResolved($resolved)
1909 | {
1910 | $this->resolved = $resolved;
1911 | }
1912 | public function getResolved()
1913 | {
1914 | return $this->resolved;
1915 | }
1916 | }
1917 |
1918 | class Google_Service_Drive_CommentList extends Google_Collection
1919 | {
1920 | protected $collection_key = 'comments';
1921 | protected $internal_gapi_mappings = array(
1922 | );
1923 | protected $commentsType = 'Google_Service_Drive_Comment';
1924 | protected $commentsDataType = 'array';
1925 | public $kind;
1926 | public $nextPageToken;
1927 |
1928 |
1929 | public function setComments($comments)
1930 | {
1931 | $this->comments = $comments;
1932 | }
1933 | public function getComments()
1934 | {
1935 | return $this->comments;
1936 | }
1937 | public function setKind($kind)
1938 | {
1939 | $this->kind = $kind;
1940 | }
1941 | public function getKind()
1942 | {
1943 | return $this->kind;
1944 | }
1945 | public function setNextPageToken($nextPageToken)
1946 | {
1947 | $this->nextPageToken = $nextPageToken;
1948 | }
1949 | public function getNextPageToken()
1950 | {
1951 | return $this->nextPageToken;
1952 | }
1953 | }
1954 |
1955 | class Google_Service_Drive_CommentQuotedFileContent extends Google_Model
1956 | {
1957 | protected $internal_gapi_mappings = array(
1958 | );
1959 | public $mimeType;
1960 | public $value;
1961 |
1962 |
1963 | public function setMimeType($mimeType)
1964 | {
1965 | $this->mimeType = $mimeType;
1966 | }
1967 | public function getMimeType()
1968 | {
1969 | return $this->mimeType;
1970 | }
1971 | public function setValue($value)
1972 | {
1973 | $this->value = $value;
1974 | }
1975 | public function getValue()
1976 | {
1977 | return $this->value;
1978 | }
1979 | }
1980 |
1981 | class Google_Service_Drive_DriveFile extends Google_Collection
1982 | {
1983 | protected $collection_key = 'spaces';
1984 | protected $internal_gapi_mappings = array(
1985 | );
1986 | public $appProperties;
1987 | protected $capabilitiesType = 'Google_Service_Drive_DriveFileCapabilities';
1988 | protected $capabilitiesDataType = '';
1989 | protected $contentHintsType = 'Google_Service_Drive_DriveFileContentHints';
1990 | protected $contentHintsDataType = '';
1991 | public $createdTime;
1992 | public $description;
1993 | public $explicitlyTrashed;
1994 | public $fileExtension;
1995 | public $folderColorRgb;
1996 | public $fullFileExtension;
1997 | public $headRevisionId;
1998 | public $iconLink;
1999 | public $id;
2000 | protected $imageMediaMetadataType = 'Google_Service_Drive_DriveFileImageMediaMetadata';
2001 | protected $imageMediaMetadataDataType = '';
2002 | public $kind;
2003 | protected $lastModifyingUserType = 'Google_Service_Drive_User';
2004 | protected $lastModifyingUserDataType = '';
2005 | public $md5Checksum;
2006 | public $mimeType;
2007 | public $modifiedByMeTime;
2008 | public $modifiedTime;
2009 | public $name;
2010 | public $originalFilename;
2011 | public $ownedByMe;
2012 | protected $ownersType = 'Google_Service_Drive_User';
2013 | protected $ownersDataType = 'array';
2014 | public $parents;
2015 | protected $permissionsType = 'Google_Service_Drive_Permission';
2016 | protected $permissionsDataType = 'array';
2017 | public $properties;
2018 | public $quotaBytesUsed;
2019 | public $shared;
2020 | public $sharedWithMeTime;
2021 | protected $sharingUserType = 'Google_Service_Drive_User';
2022 | protected $sharingUserDataType = '';
2023 | public $size;
2024 | public $spaces;
2025 | public $starred;
2026 | public $thumbnailLink;
2027 | public $trashed;
2028 | public $version;
2029 | protected $videoMediaMetadataType = 'Google_Service_Drive_DriveFileVideoMediaMetadata';
2030 | protected $videoMediaMetadataDataType = '';
2031 | public $viewedByMe;
2032 | public $viewedByMeTime;
2033 | public $viewersCanCopyContent;
2034 | public $webContentLink;
2035 | public $webViewLink;
2036 | public $writersCanShare;
2037 |
2038 |
2039 | public function setAppProperties($appProperties)
2040 | {
2041 | $this->appProperties = $appProperties;
2042 | }
2043 | public function getAppProperties()
2044 | {
2045 | return $this->appProperties;
2046 | }
2047 | public function setCapabilities(Google_Service_Drive_DriveFileCapabilities $capabilities)
2048 | {
2049 | $this->capabilities = $capabilities;
2050 | }
2051 | public function getCapabilities()
2052 | {
2053 | return $this->capabilities;
2054 | }
2055 | public function setContentHints(Google_Service_Drive_DriveFileContentHints $contentHints)
2056 | {
2057 | $this->contentHints = $contentHints;
2058 | }
2059 | public function getContentHints()
2060 | {
2061 | return $this->contentHints;
2062 | }
2063 | public function setCreatedTime($createdTime)
2064 | {
2065 | $this->createdTime = $createdTime;
2066 | }
2067 | public function getCreatedTime()
2068 | {
2069 | return $this->createdTime;
2070 | }
2071 | public function setDescription($description)
2072 | {
2073 | $this->description = $description;
2074 | }
2075 | public function getDescription()
2076 | {
2077 | return $this->description;
2078 | }
2079 | public function setExplicitlyTrashed($explicitlyTrashed)
2080 | {
2081 | $this->explicitlyTrashed = $explicitlyTrashed;
2082 | }
2083 | public function getExplicitlyTrashed()
2084 | {
2085 | return $this->explicitlyTrashed;
2086 | }
2087 | public function setFileExtension($fileExtension)
2088 | {
2089 | $this->fileExtension = $fileExtension;
2090 | }
2091 | public function getFileExtension()
2092 | {
2093 | return $this->fileExtension;
2094 | }
2095 | public function setFolderColorRgb($folderColorRgb)
2096 | {
2097 | $this->folderColorRgb = $folderColorRgb;
2098 | }
2099 | public function getFolderColorRgb()
2100 | {
2101 | return $this->folderColorRgb;
2102 | }
2103 | public function setFullFileExtension($fullFileExtension)
2104 | {
2105 | $this->fullFileExtension = $fullFileExtension;
2106 | }
2107 | public function getFullFileExtension()
2108 | {
2109 | return $this->fullFileExtension;
2110 | }
2111 | public function setHeadRevisionId($headRevisionId)
2112 | {
2113 | $this->headRevisionId = $headRevisionId;
2114 | }
2115 | public function getHeadRevisionId()
2116 | {
2117 | return $this->headRevisionId;
2118 | }
2119 | public function setIconLink($iconLink)
2120 | {
2121 | $this->iconLink = $iconLink;
2122 | }
2123 | public function getIconLink()
2124 | {
2125 | return $this->iconLink;
2126 | }
2127 | public function setId($id)
2128 | {
2129 | $this->id = $id;
2130 | }
2131 | public function getId()
2132 | {
2133 | return $this->id;
2134 | }
2135 | public function setImageMediaMetadata(Google_Service_Drive_DriveFileImageMediaMetadata $imageMediaMetadata)
2136 | {
2137 | $this->imageMediaMetadata = $imageMediaMetadata;
2138 | }
2139 | public function getImageMediaMetadata()
2140 | {
2141 | return $this->imageMediaMetadata;
2142 | }
2143 | public function setKind($kind)
2144 | {
2145 | $this->kind = $kind;
2146 | }
2147 | public function getKind()
2148 | {
2149 | return $this->kind;
2150 | }
2151 | public function setLastModifyingUser(Google_Service_Drive_User $lastModifyingUser)
2152 | {
2153 | $this->lastModifyingUser = $lastModifyingUser;
2154 | }
2155 | public function getLastModifyingUser()
2156 | {
2157 | return $this->lastModifyingUser;
2158 | }
2159 | public function setMd5Checksum($md5Checksum)
2160 | {
2161 | $this->md5Checksum = $md5Checksum;
2162 | }
2163 | public function getMd5Checksum()
2164 | {
2165 | return $this->md5Checksum;
2166 | }
2167 | public function setMimeType($mimeType)
2168 | {
2169 | $this->mimeType = $mimeType;
2170 | }
2171 | public function getMimeType()
2172 | {
2173 | return $this->mimeType;
2174 | }
2175 | public function setModifiedByMeTime($modifiedByMeTime)
2176 | {
2177 | $this->modifiedByMeTime = $modifiedByMeTime;
2178 | }
2179 | public function getModifiedByMeTime()
2180 | {
2181 | return $this->modifiedByMeTime;
2182 | }
2183 | public function setModifiedTime($modifiedTime)
2184 | {
2185 | $this->modifiedTime = $modifiedTime;
2186 | }
2187 | public function getModifiedTime()
2188 | {
2189 | return $this->modifiedTime;
2190 | }
2191 | public function setName($name)
2192 | {
2193 | $this->name = $name;
2194 | }
2195 | public function getName()
2196 | {
2197 | return $this->name;
2198 | }
2199 | public function setOriginalFilename($originalFilename)
2200 | {
2201 | $this->originalFilename = $originalFilename;
2202 | }
2203 | public function getOriginalFilename()
2204 | {
2205 | return $this->originalFilename;
2206 | }
2207 | public function setOwnedByMe($ownedByMe)
2208 | {
2209 | $this->ownedByMe = $ownedByMe;
2210 | }
2211 | public function getOwnedByMe()
2212 | {
2213 | return $this->ownedByMe;
2214 | }
2215 | public function setOwners($owners)
2216 | {
2217 | $this->owners = $owners;
2218 | }
2219 | public function getOwners()
2220 | {
2221 | return $this->owners;
2222 | }
2223 | public function setParents($parents)
2224 | {
2225 | $this->parents = $parents;
2226 | }
2227 | public function getParents()
2228 | {
2229 | return $this->parents;
2230 | }
2231 | public function setPermissions($permissions)
2232 | {
2233 | $this->permissions = $permissions;
2234 | }
2235 | public function getPermissions()
2236 | {
2237 | return $this->permissions;
2238 | }
2239 | public function setProperties($properties)
2240 | {
2241 | $this->properties = $properties;
2242 | }
2243 | public function getProperties()
2244 | {
2245 | return $this->properties;
2246 | }
2247 | public function setQuotaBytesUsed($quotaBytesUsed)
2248 | {
2249 | $this->quotaBytesUsed = $quotaBytesUsed;
2250 | }
2251 | public function getQuotaBytesUsed()
2252 | {
2253 | return $this->quotaBytesUsed;
2254 | }
2255 | public function setShared($shared)
2256 | {
2257 | $this->shared = $shared;
2258 | }
2259 | public function getShared()
2260 | {
2261 | return $this->shared;
2262 | }
2263 | public function setSharedWithMeTime($sharedWithMeTime)
2264 | {
2265 | $this->sharedWithMeTime = $sharedWithMeTime;
2266 | }
2267 | public function getSharedWithMeTime()
2268 | {
2269 | return $this->sharedWithMeTime;
2270 | }
2271 | public function setSharingUser(Google_Service_Drive_User $sharingUser)
2272 | {
2273 | $this->sharingUser = $sharingUser;
2274 | }
2275 | public function getSharingUser()
2276 | {
2277 | return $this->sharingUser;
2278 | }
2279 | public function setSize($size)
2280 | {
2281 | $this->size = $size;
2282 | }
2283 | public function getSize()
2284 | {
2285 | return $this->size;
2286 | }
2287 | public function setSpaces($spaces)
2288 | {
2289 | $this->spaces = $spaces;
2290 | }
2291 | public function getSpaces()
2292 | {
2293 | return $this->spaces;
2294 | }
2295 | public function setStarred($starred)
2296 | {
2297 | $this->starred = $starred;
2298 | }
2299 | public function getStarred()
2300 | {
2301 | return $this->starred;
2302 | }
2303 | public function setThumbnailLink($thumbnailLink)
2304 | {
2305 | $this->thumbnailLink = $thumbnailLink;
2306 | }
2307 | public function getThumbnailLink()
2308 | {
2309 | return $this->thumbnailLink;
2310 | }
2311 | public function setTrashed($trashed)
2312 | {
2313 | $this->trashed = $trashed;
2314 | }
2315 | public function getTrashed()
2316 | {
2317 | return $this->trashed;
2318 | }
2319 | public function setVersion($version)
2320 | {
2321 | $this->version = $version;
2322 | }
2323 | public function getVersion()
2324 | {
2325 | return $this->version;
2326 | }
2327 | public function setVideoMediaMetadata(Google_Service_Drive_DriveFileVideoMediaMetadata $videoMediaMetadata)
2328 | {
2329 | $this->videoMediaMetadata = $videoMediaMetadata;
2330 | }
2331 | public function getVideoMediaMetadata()
2332 | {
2333 | return $this->videoMediaMetadata;
2334 | }
2335 | public function setViewedByMe($viewedByMe)
2336 | {
2337 | $this->viewedByMe = $viewedByMe;
2338 | }
2339 | public function getViewedByMe()
2340 | {
2341 | return $this->viewedByMe;
2342 | }
2343 | public function setViewedByMeTime($viewedByMeTime)
2344 | {
2345 | $this->viewedByMeTime = $viewedByMeTime;
2346 | }
2347 | public function getViewedByMeTime()
2348 | {
2349 | return $this->viewedByMeTime;
2350 | }
2351 | public function setViewersCanCopyContent($viewersCanCopyContent)
2352 | {
2353 | $this->viewersCanCopyContent = $viewersCanCopyContent;
2354 | }
2355 | public function getViewersCanCopyContent()
2356 | {
2357 | return $this->viewersCanCopyContent;
2358 | }
2359 | public function setWebContentLink($webContentLink)
2360 | {
2361 | $this->webContentLink = $webContentLink;
2362 | }
2363 | public function getWebContentLink()
2364 | {
2365 | return $this->webContentLink;
2366 | }
2367 | public function setWebViewLink($webViewLink)
2368 | {
2369 | $this->webViewLink = $webViewLink;
2370 | }
2371 | public function getWebViewLink()
2372 | {
2373 | return $this->webViewLink;
2374 | }
2375 | public function setWritersCanShare($writersCanShare)
2376 | {
2377 | $this->writersCanShare = $writersCanShare;
2378 | }
2379 | public function getWritersCanShare()
2380 | {
2381 | return $this->writersCanShare;
2382 | }
2383 | }
2384 |
2385 | class Google_Service_Drive_DriveFileAppProperties extends Google_Model
2386 | {
2387 | }
2388 |
2389 | class Google_Service_Drive_DriveFileCapabilities extends Google_Model
2390 | {
2391 | protected $internal_gapi_mappings = array(
2392 | );
2393 | public $canComment;
2394 | public $canCopy;
2395 | public $canEdit;
2396 | public $canShare;
2397 |
2398 |
2399 | public function setCanComment($canComment)
2400 | {
2401 | $this->canComment = $canComment;
2402 | }
2403 | public function getCanComment()
2404 | {
2405 | return $this->canComment;
2406 | }
2407 | public function setCanCopy($canCopy)
2408 | {
2409 | $this->canCopy = $canCopy;
2410 | }
2411 | public function getCanCopy()
2412 | {
2413 | return $this->canCopy;
2414 | }
2415 | public function setCanEdit($canEdit)
2416 | {
2417 | $this->canEdit = $canEdit;
2418 | }
2419 | public function getCanEdit()
2420 | {
2421 | return $this->canEdit;
2422 | }
2423 | public function setCanShare($canShare)
2424 | {
2425 | $this->canShare = $canShare;
2426 | }
2427 | public function getCanShare()
2428 | {
2429 | return $this->canShare;
2430 | }
2431 | }
2432 |
2433 | class Google_Service_Drive_DriveFileContentHints extends Google_Model
2434 | {
2435 | protected $internal_gapi_mappings = array(
2436 | );
2437 | public $indexableText;
2438 | protected $thumbnailType = 'Google_Service_Drive_DriveFileContentHintsThumbnail';
2439 | protected $thumbnailDataType = '';
2440 |
2441 |
2442 | public function setIndexableText($indexableText)
2443 | {
2444 | $this->indexableText = $indexableText;
2445 | }
2446 | public function getIndexableText()
2447 | {
2448 | return $this->indexableText;
2449 | }
2450 | public function setThumbnail(Google_Service_Drive_DriveFileContentHintsThumbnail $thumbnail)
2451 | {
2452 | $this->thumbnail = $thumbnail;
2453 | }
2454 | public function getThumbnail()
2455 | {
2456 | return $this->thumbnail;
2457 | }
2458 | }
2459 |
2460 | class Google_Service_Drive_DriveFileContentHintsThumbnail extends Google_Model
2461 | {
2462 | protected $internal_gapi_mappings = array(
2463 | );
2464 | public $image;
2465 | public $mimeType;
2466 |
2467 |
2468 | public function setImage($image)
2469 | {
2470 | $this->image = $image;
2471 | }
2472 | public function getImage()
2473 | {
2474 | return $this->image;
2475 | }
2476 | public function setMimeType($mimeType)
2477 | {
2478 | $this->mimeType = $mimeType;
2479 | }
2480 | public function getMimeType()
2481 | {
2482 | return $this->mimeType;
2483 | }
2484 | }
2485 |
2486 | class Google_Service_Drive_DriveFileImageMediaMetadata extends Google_Model
2487 | {
2488 | protected $internal_gapi_mappings = array(
2489 | );
2490 | public $aperture;
2491 | public $cameraMake;
2492 | public $cameraModel;
2493 | public $colorSpace;
2494 | public $exposureBias;
2495 | public $exposureMode;
2496 | public $exposureTime;
2497 | public $flashUsed;
2498 | public $focalLength;
2499 | public $height;
2500 | public $isoSpeed;
2501 | public $lens;
2502 | protected $locationType = 'Google_Service_Drive_DriveFileImageMediaMetadataLocation';
2503 | protected $locationDataType = '';
2504 | public $maxApertureValue;
2505 | public $meteringMode;
2506 | public $rotation;
2507 | public $sensor;
2508 | public $subjectDistance;
2509 | public $time;
2510 | public $whiteBalance;
2511 | public $width;
2512 |
2513 |
2514 | public function setAperture($aperture)
2515 | {
2516 | $this->aperture = $aperture;
2517 | }
2518 | public function getAperture()
2519 | {
2520 | return $this->aperture;
2521 | }
2522 | public function setCameraMake($cameraMake)
2523 | {
2524 | $this->cameraMake = $cameraMake;
2525 | }
2526 | public function getCameraMake()
2527 | {
2528 | return $this->cameraMake;
2529 | }
2530 | public function setCameraModel($cameraModel)
2531 | {
2532 | $this->cameraModel = $cameraModel;
2533 | }
2534 | public function getCameraModel()
2535 | {
2536 | return $this->cameraModel;
2537 | }
2538 | public function setColorSpace($colorSpace)
2539 | {
2540 | $this->colorSpace = $colorSpace;
2541 | }
2542 | public function getColorSpace()
2543 | {
2544 | return $this->colorSpace;
2545 | }
2546 | public function setExposureBias($exposureBias)
2547 | {
2548 | $this->exposureBias = $exposureBias;
2549 | }
2550 | public function getExposureBias()
2551 | {
2552 | return $this->exposureBias;
2553 | }
2554 | public function setExposureMode($exposureMode)
2555 | {
2556 | $this->exposureMode = $exposureMode;
2557 | }
2558 | public function getExposureMode()
2559 | {
2560 | return $this->exposureMode;
2561 | }
2562 | public function setExposureTime($exposureTime)
2563 | {
2564 | $this->exposureTime = $exposureTime;
2565 | }
2566 | public function getExposureTime()
2567 | {
2568 | return $this->exposureTime;
2569 | }
2570 | public function setFlashUsed($flashUsed)
2571 | {
2572 | $this->flashUsed = $flashUsed;
2573 | }
2574 | public function getFlashUsed()
2575 | {
2576 | return $this->flashUsed;
2577 | }
2578 | public function setFocalLength($focalLength)
2579 | {
2580 | $this->focalLength = $focalLength;
2581 | }
2582 | public function getFocalLength()
2583 | {
2584 | return $this->focalLength;
2585 | }
2586 | public function setHeight($height)
2587 | {
2588 | $this->height = $height;
2589 | }
2590 | public function getHeight()
2591 | {
2592 | return $this->height;
2593 | }
2594 | public function setIsoSpeed($isoSpeed)
2595 | {
2596 | $this->isoSpeed = $isoSpeed;
2597 | }
2598 | public function getIsoSpeed()
2599 | {
2600 | return $this->isoSpeed;
2601 | }
2602 | public function setLens($lens)
2603 | {
2604 | $this->lens = $lens;
2605 | }
2606 | public function getLens()
2607 | {
2608 | return $this->lens;
2609 | }
2610 | public function setLocation(Google_Service_Drive_DriveFileImageMediaMetadataLocation $location)
2611 | {
2612 | $this->location = $location;
2613 | }
2614 | public function getLocation()
2615 | {
2616 | return $this->location;
2617 | }
2618 | public function setMaxApertureValue($maxApertureValue)
2619 | {
2620 | $this->maxApertureValue = $maxApertureValue;
2621 | }
2622 | public function getMaxApertureValue()
2623 | {
2624 | return $this->maxApertureValue;
2625 | }
2626 | public function setMeteringMode($meteringMode)
2627 | {
2628 | $this->meteringMode = $meteringMode;
2629 | }
2630 | public function getMeteringMode()
2631 | {
2632 | return $this->meteringMode;
2633 | }
2634 | public function setRotation($rotation)
2635 | {
2636 | $this->rotation = $rotation;
2637 | }
2638 | public function getRotation()
2639 | {
2640 | return $this->rotation;
2641 | }
2642 | public function setSensor($sensor)
2643 | {
2644 | $this->sensor = $sensor;
2645 | }
2646 | public function getSensor()
2647 | {
2648 | return $this->sensor;
2649 | }
2650 | public function setSubjectDistance($subjectDistance)
2651 | {
2652 | $this->subjectDistance = $subjectDistance;
2653 | }
2654 | public function getSubjectDistance()
2655 | {
2656 | return $this->subjectDistance;
2657 | }
2658 | public function setTime($time)
2659 | {
2660 | $this->time = $time;
2661 | }
2662 | public function getTime()
2663 | {
2664 | return $this->time;
2665 | }
2666 | public function setWhiteBalance($whiteBalance)
2667 | {
2668 | $this->whiteBalance = $whiteBalance;
2669 | }
2670 | public function getWhiteBalance()
2671 | {
2672 | return $this->whiteBalance;
2673 | }
2674 | public function setWidth($width)
2675 | {
2676 | $this->width = $width;
2677 | }
2678 | public function getWidth()
2679 | {
2680 | return $this->width;
2681 | }
2682 | }
2683 |
2684 | class Google_Service_Drive_DriveFileImageMediaMetadataLocation extends Google_Model
2685 | {
2686 | protected $internal_gapi_mappings = array(
2687 | );
2688 | public $altitude;
2689 | public $latitude;
2690 | public $longitude;
2691 |
2692 |
2693 | public function setAltitude($altitude)
2694 | {
2695 | $this->altitude = $altitude;
2696 | }
2697 | public function getAltitude()
2698 | {
2699 | return $this->altitude;
2700 | }
2701 | public function setLatitude($latitude)
2702 | {
2703 | $this->latitude = $latitude;
2704 | }
2705 | public function getLatitude()
2706 | {
2707 | return $this->latitude;
2708 | }
2709 | public function setLongitude($longitude)
2710 | {
2711 | $this->longitude = $longitude;
2712 | }
2713 | public function getLongitude()
2714 | {
2715 | return $this->longitude;
2716 | }
2717 | }
2718 |
2719 | class Google_Service_Drive_DriveFileProperties extends Google_Model
2720 | {
2721 | }
2722 |
2723 | class Google_Service_Drive_DriveFileVideoMediaMetadata extends Google_Model
2724 | {
2725 | protected $internal_gapi_mappings = array(
2726 | );
2727 | public $durationMillis;
2728 | public $height;
2729 | public $width;
2730 |
2731 |
2732 | public function setDurationMillis($durationMillis)
2733 | {
2734 | $this->durationMillis = $durationMillis;
2735 | }
2736 | public function getDurationMillis()
2737 | {
2738 | return $this->durationMillis;
2739 | }
2740 | public function setHeight($height)
2741 | {
2742 | $this->height = $height;
2743 | }
2744 | public function getHeight()
2745 | {
2746 | return $this->height;
2747 | }
2748 | public function setWidth($width)
2749 | {
2750 | $this->width = $width;
2751 | }
2752 | public function getWidth()
2753 | {
2754 | return $this->width;
2755 | }
2756 | }
2757 |
2758 | class Google_Service_Drive_FileList extends Google_Collection
2759 | {
2760 | protected $collection_key = 'files';
2761 | protected $internal_gapi_mappings = array(
2762 | );
2763 | protected $filesType = 'Google_Service_Drive_DriveFile';
2764 | protected $filesDataType = 'array';
2765 | public $kind;
2766 | public $nextPageToken;
2767 |
2768 |
2769 | public function setFiles($files)
2770 | {
2771 | $this->files = $files;
2772 | }
2773 | public function getFiles()
2774 | {
2775 | return $this->files;
2776 | }
2777 | public function setKind($kind)
2778 | {
2779 | $this->kind = $kind;
2780 | }
2781 | public function getKind()
2782 | {
2783 | return $this->kind;
2784 | }
2785 | public function setNextPageToken($nextPageToken)
2786 | {
2787 | $this->nextPageToken = $nextPageToken;
2788 | }
2789 | public function getNextPageToken()
2790 | {
2791 | return $this->nextPageToken;
2792 | }
2793 | }
2794 |
2795 | class Google_Service_Drive_GeneratedIds extends Google_Collection
2796 | {
2797 | protected $collection_key = 'ids';
2798 | protected $internal_gapi_mappings = array(
2799 | );
2800 | public $ids;
2801 | public $kind;
2802 | public $space;
2803 |
2804 |
2805 | public function setIds($ids)
2806 | {
2807 | $this->ids = $ids;
2808 | }
2809 | public function getIds()
2810 | {
2811 | return $this->ids;
2812 | }
2813 | public function setKind($kind)
2814 | {
2815 | $this->kind = $kind;
2816 | }
2817 | public function getKind()
2818 | {
2819 | return $this->kind;
2820 | }
2821 | public function setSpace($space)
2822 | {
2823 | $this->space = $space;
2824 | }
2825 | public function getSpace()
2826 | {
2827 | return $this->space;
2828 | }
2829 | }
2830 |
2831 | class Google_Service_Drive_Permission extends Google_Model
2832 | {
2833 | protected $internal_gapi_mappings = array(
2834 | );
2835 | public $allowFileDiscovery;
2836 | public $displayName;
2837 | public $domain;
2838 | public $emailAddress;
2839 | public $id;
2840 | public $kind;
2841 | public $photoLink;
2842 | public $role;
2843 | public $type;
2844 |
2845 |
2846 | public function setAllowFileDiscovery($allowFileDiscovery)
2847 | {
2848 | $this->allowFileDiscovery = $allowFileDiscovery;
2849 | }
2850 | public function getAllowFileDiscovery()
2851 | {
2852 | return $this->allowFileDiscovery;
2853 | }
2854 | public function setDisplayName($displayName)
2855 | {
2856 | $this->displayName = $displayName;
2857 | }
2858 | public function getDisplayName()
2859 | {
2860 | return $this->displayName;
2861 | }
2862 | public function setDomain($domain)
2863 | {
2864 | $this->domain = $domain;
2865 | }
2866 | public function getDomain()
2867 | {
2868 | return $this->domain;
2869 | }
2870 | public function setEmailAddress($emailAddress)
2871 | {
2872 | $this->emailAddress = $emailAddress;
2873 | }
2874 | public function getEmailAddress()
2875 | {
2876 | return $this->emailAddress;
2877 | }
2878 | public function setId($id)
2879 | {
2880 | $this->id = $id;
2881 | }
2882 | public function getId()
2883 | {
2884 | return $this->id;
2885 | }
2886 | public function setKind($kind)
2887 | {
2888 | $this->kind = $kind;
2889 | }
2890 | public function getKind()
2891 | {
2892 | return $this->kind;
2893 | }
2894 | public function setPhotoLink($photoLink)
2895 | {
2896 | $this->photoLink = $photoLink;
2897 | }
2898 | public function getPhotoLink()
2899 | {
2900 | return $this->photoLink;
2901 | }
2902 | public function setRole($role)
2903 | {
2904 | $this->role = $role;
2905 | }
2906 | public function getRole()
2907 | {
2908 | return $this->role;
2909 | }
2910 | public function setType($type)
2911 | {
2912 | $this->type = $type;
2913 | }
2914 | public function getType()
2915 | {
2916 | return $this->type;
2917 | }
2918 | }
2919 |
2920 | class Google_Service_Drive_PermissionList extends Google_Collection
2921 | {
2922 | protected $collection_key = 'permissions';
2923 | protected $internal_gapi_mappings = array(
2924 | );
2925 | public $kind;
2926 | protected $permissionsType = 'Google_Service_Drive_Permission';
2927 | protected $permissionsDataType = 'array';
2928 |
2929 |
2930 | public function setKind($kind)
2931 | {
2932 | $this->kind = $kind;
2933 | }
2934 | public function getKind()
2935 | {
2936 | return $this->kind;
2937 | }
2938 | public function setPermissions($permissions)
2939 | {
2940 | $this->permissions = $permissions;
2941 | }
2942 | public function getPermissions()
2943 | {
2944 | return $this->permissions;
2945 | }
2946 | }
2947 |
2948 | class Google_Service_Drive_Reply extends Google_Model
2949 | {
2950 | protected $internal_gapi_mappings = array(
2951 | );
2952 | public $action;
2953 | protected $authorType = 'Google_Service_Drive_User';
2954 | protected $authorDataType = '';
2955 | public $content;
2956 | public $createdTime;
2957 | public $deleted;
2958 | public $htmlContent;
2959 | public $id;
2960 | public $kind;
2961 | public $modifiedTime;
2962 |
2963 |
2964 | public function setAction($action)
2965 | {
2966 | $this->action = $action;
2967 | }
2968 | public function getAction()
2969 | {
2970 | return $this->action;
2971 | }
2972 | public function setAuthor(Google_Service_Drive_User $author)
2973 | {
2974 | $this->author = $author;
2975 | }
2976 | public function getAuthor()
2977 | {
2978 | return $this->author;
2979 | }
2980 | public function setContent($content)
2981 | {
2982 | $this->content = $content;
2983 | }
2984 | public function getContent()
2985 | {
2986 | return $this->content;
2987 | }
2988 | public function setCreatedTime($createdTime)
2989 | {
2990 | $this->createdTime = $createdTime;
2991 | }
2992 | public function getCreatedTime()
2993 | {
2994 | return $this->createdTime;
2995 | }
2996 | public function setDeleted($deleted)
2997 | {
2998 | $this->deleted = $deleted;
2999 | }
3000 | public function getDeleted()
3001 | {
3002 | return $this->deleted;
3003 | }
3004 | public function setHtmlContent($htmlContent)
3005 | {
3006 | $this->htmlContent = $htmlContent;
3007 | }
3008 | public function getHtmlContent()
3009 | {
3010 | return $this->htmlContent;
3011 | }
3012 | public function setId($id)
3013 | {
3014 | $this->id = $id;
3015 | }
3016 | public function getId()
3017 | {
3018 | return $this->id;
3019 | }
3020 | public function setKind($kind)
3021 | {
3022 | $this->kind = $kind;
3023 | }
3024 | public function getKind()
3025 | {
3026 | return $this->kind;
3027 | }
3028 | public function setModifiedTime($modifiedTime)
3029 | {
3030 | $this->modifiedTime = $modifiedTime;
3031 | }
3032 | public function getModifiedTime()
3033 | {
3034 | return $this->modifiedTime;
3035 | }
3036 | }
3037 |
3038 | class Google_Service_Drive_ReplyList extends Google_Collection
3039 | {
3040 | protected $collection_key = 'replies';
3041 | protected $internal_gapi_mappings = array(
3042 | );
3043 | public $kind;
3044 | public $nextPageToken;
3045 | protected $repliesType = 'Google_Service_Drive_Reply';
3046 | protected $repliesDataType = 'array';
3047 |
3048 |
3049 | public function setKind($kind)
3050 | {
3051 | $this->kind = $kind;
3052 | }
3053 | public function getKind()
3054 | {
3055 | return $this->kind;
3056 | }
3057 | public function setNextPageToken($nextPageToken)
3058 | {
3059 | $this->nextPageToken = $nextPageToken;
3060 | }
3061 | public function getNextPageToken()
3062 | {
3063 | return $this->nextPageToken;
3064 | }
3065 | public function setReplies($replies)
3066 | {
3067 | $this->replies = $replies;
3068 | }
3069 | public function getReplies()
3070 | {
3071 | return $this->replies;
3072 | }
3073 | }
3074 |
3075 | class Google_Service_Drive_Revision extends Google_Model
3076 | {
3077 | protected $internal_gapi_mappings = array(
3078 | );
3079 | public $id;
3080 | public $keepForever;
3081 | public $kind;
3082 | protected $lastModifyingUserType = 'Google_Service_Drive_User';
3083 | protected $lastModifyingUserDataType = '';
3084 | public $md5Checksum;
3085 | public $mimeType;
3086 | public $modifiedTime;
3087 | public $originalFilename;
3088 | public $publishAuto;
3089 | public $published;
3090 | public $publishedOutsideDomain;
3091 | public $size;
3092 |
3093 |
3094 | public function setId($id)
3095 | {
3096 | $this->id = $id;
3097 | }
3098 | public function getId()
3099 | {
3100 | return $this->id;
3101 | }
3102 | public function setKeepForever($keepForever)
3103 | {
3104 | $this->keepForever = $keepForever;
3105 | }
3106 | public function getKeepForever()
3107 | {
3108 | return $this->keepForever;
3109 | }
3110 | public function setKind($kind)
3111 | {
3112 | $this->kind = $kind;
3113 | }
3114 | public function getKind()
3115 | {
3116 | return $this->kind;
3117 | }
3118 | public function setLastModifyingUser(Google_Service_Drive_User $lastModifyingUser)
3119 | {
3120 | $this->lastModifyingUser = $lastModifyingUser;
3121 | }
3122 | public function getLastModifyingUser()
3123 | {
3124 | return $this->lastModifyingUser;
3125 | }
3126 | public function setMd5Checksum($md5Checksum)
3127 | {
3128 | $this->md5Checksum = $md5Checksum;
3129 | }
3130 | public function getMd5Checksum()
3131 | {
3132 | return $this->md5Checksum;
3133 | }
3134 | public function setMimeType($mimeType)
3135 | {
3136 | $this->mimeType = $mimeType;
3137 | }
3138 | public function getMimeType()
3139 | {
3140 | return $this->mimeType;
3141 | }
3142 | public function setModifiedTime($modifiedTime)
3143 | {
3144 | $this->modifiedTime = $modifiedTime;
3145 | }
3146 | public function getModifiedTime()
3147 | {
3148 | return $this->modifiedTime;
3149 | }
3150 | public function setOriginalFilename($originalFilename)
3151 | {
3152 | $this->originalFilename = $originalFilename;
3153 | }
3154 | public function getOriginalFilename()
3155 | {
3156 | return $this->originalFilename;
3157 | }
3158 | public function setPublishAuto($publishAuto)
3159 | {
3160 | $this->publishAuto = $publishAuto;
3161 | }
3162 | public function getPublishAuto()
3163 | {
3164 | return $this->publishAuto;
3165 | }
3166 | public function setPublished($published)
3167 | {
3168 | $this->published = $published;
3169 | }
3170 | public function getPublished()
3171 | {
3172 | return $this->published;
3173 | }
3174 | public function setPublishedOutsideDomain($publishedOutsideDomain)
3175 | {
3176 | $this->publishedOutsideDomain = $publishedOutsideDomain;
3177 | }
3178 | public function getPublishedOutsideDomain()
3179 | {
3180 | return $this->publishedOutsideDomain;
3181 | }
3182 | public function setSize($size)
3183 | {
3184 | $this->size = $size;
3185 | }
3186 | public function getSize()
3187 | {
3188 | return $this->size;
3189 | }
3190 | }
3191 |
3192 | class Google_Service_Drive_RevisionList extends Google_Collection
3193 | {
3194 | protected $collection_key = 'revisions';
3195 | protected $internal_gapi_mappings = array(
3196 | );
3197 | public $kind;
3198 | protected $revisionsType = 'Google_Service_Drive_Revision';
3199 | protected $revisionsDataType = 'array';
3200 |
3201 |
3202 | public function setKind($kind)
3203 | {
3204 | $this->kind = $kind;
3205 | }
3206 | public function getKind()
3207 | {
3208 | return $this->kind;
3209 | }
3210 | public function setRevisions($revisions)
3211 | {
3212 | $this->revisions = $revisions;
3213 | }
3214 | public function getRevisions()
3215 | {
3216 | return $this->revisions;
3217 | }
3218 | }
3219 |
3220 | class Google_Service_Drive_StartPageToken extends Google_Model
3221 | {
3222 | protected $internal_gapi_mappings = array(
3223 | );
3224 | public $kind;
3225 | public $startPageToken;
3226 |
3227 |
3228 | public function setKind($kind)
3229 | {
3230 | $this->kind = $kind;
3231 | }
3232 | public function getKind()
3233 | {
3234 | return $this->kind;
3235 | }
3236 | public function setStartPageToken($startPageToken)
3237 | {
3238 | $this->startPageToken = $startPageToken;
3239 | }
3240 | public function getStartPageToken()
3241 | {
3242 | return $this->startPageToken;
3243 | }
3244 | }
3245 |
3246 | class Google_Service_Drive_User extends Google_Model
3247 | {
3248 | protected $internal_gapi_mappings = array(
3249 | );
3250 | public $displayName;
3251 | public $emailAddress;
3252 | public $kind;
3253 | public $me;
3254 | public $permissionId;
3255 | public $photoLink;
3256 |
3257 |
3258 | public function setDisplayName($displayName)
3259 | {
3260 | $this->displayName = $displayName;
3261 | }
3262 | public function getDisplayName()
3263 | {
3264 | return $this->displayName;
3265 | }
3266 | public function setEmailAddress($emailAddress)
3267 | {
3268 | $this->emailAddress = $emailAddress;
3269 | }
3270 | public function getEmailAddress()
3271 | {
3272 | return $this->emailAddress;
3273 | }
3274 | public function setKind($kind)
3275 | {
3276 | $this->kind = $kind;
3277 | }
3278 | public function getKind()
3279 | {
3280 | return $this->kind;
3281 | }
3282 | public function setMe($me)
3283 | {
3284 | $this->me = $me;
3285 | }
3286 | public function getMe()
3287 | {
3288 | return $this->me;
3289 | }
3290 | public function setPermissionId($permissionId)
3291 | {
3292 | $this->permissionId = $permissionId;
3293 | }
3294 | public function getPermissionId()
3295 | {
3296 | return $this->permissionId;
3297 | }
3298 | public function setPhotoLink($photoLink)
3299 | {
3300 | $this->photoLink = $photoLink;
3301 | }
3302 | public function getPhotoLink()
3303 | {
3304 | return $this->photoLink;
3305 | }
3306 | }
3307 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Automated Backup MySQL & Upload to Google Drive with PHP
2 |
3 | - Clone this repo
4 | - Composer update
5 | - Move the `Drive.php` to `./vendor/google/apiclient/src/Google/Service` (replace the existing)
6 | - Create API creadentials by following this [step](https://developers.google.com/drive/v3/web/quickstart/php#step_1_turn_on_the_api_name)
7 | - Put the `client.json` as `client_secret.json` in this root directory
8 | - Create `.env` based on `.env.example` file as your system config
9 |
--------------------------------------------------------------------------------
/client_secret.json.example:
--------------------------------------------------------------------------------
1 | {"installed":{"client_id":"JKHKJHKJH-kAJKLSJALKSJlkAJSLK.apps.googleusercontent.com","project_id":"api-project-SADOIUAOIS","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://accounts.google.com/o/oauth2/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"1283j123hi-lOmJH","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "require": {
3 | "google/apiclient": "1.*",
4 | "ifsnop/mysqldump-php": "2.*",
5 | "vlucas/phpdotenv": "^2.2",
6 | "maknz/slack": "^1.7"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 | load();
10 | } catch (Exception $e) {
11 | echo "Please provide .env config . see .env.example!\n";die();
12 | }
13 |
14 | define('APPLICATION_NAME', getenv('APPLICATION_NAME'));
15 | define('CREDENTIALS_PATH', '~/.credentials/' . getenv('CREDENTIALS_NAME'));
16 | define('CLIENT_SECRET_PATH', __DIR__ . '/client_secret.json');
17 | define('DIRECTORY_TO_SAVE', getenv('DIRECTORY_TO_SAVE'));
18 | // If modifying these scopes, delete your previously saved credentials
19 | // at ~/.credentials/drive-php-quickstart.json
20 | define('SCOPES', implode(' ', array(
21 | Google_Service_Drive::DRIVE,
22 | )
23 | ));
24 |
25 | if (php_sapi_name() != 'cli') {
26 | writeLog("Check the Request Come From", false);
27 | throw new Exception('This application must be run on the command line.');
28 | writeLog("Check the Request Come From: OK!", false);
29 | }
30 |
31 | /**
32 | * Returns an authorized API client.
33 | * @return Google_Client the authorized client object
34 | */
35 | function getClient() {
36 | writeLog("Getting Permission from Google Drive!");
37 |
38 | $client = new Google_Client();
39 | $client->setApplicationName(APPLICATION_NAME);
40 | $client->setScopes(SCOPES);
41 | $client->setAuthConfigFile(CLIENT_SECRET_PATH);
42 | $client->setAccessType('offline');
43 |
44 | // Load previously authorized credentials from a file.
45 | $credentialsPath = expandHomeDirectory(CREDENTIALS_PATH);
46 | if (file_exists($credentialsPath)) {
47 | writeLog("Use saved credentials");
48 | $accessToken = file_get_contents($credentialsPath);
49 | } else {
50 | writeLog("Get new credentials");
51 | // Request authorization from the user.
52 | $authUrl = $client->createAuthUrl();
53 | printf("Open the following link in your browser:\n%s\n", $authUrl);
54 | print 'Enter verification code: ';
55 | $authCode = trim(fgets(STDIN));
56 |
57 | // Exchange authorization code for an access token.
58 | $accessToken = $client->authenticate($authCode);
59 |
60 | // Store the credentials to disk.
61 | if(!file_exists(dirname($credentialsPath))) {
62 | mkdir(dirname($credentialsPath), 0700, true);
63 | }
64 | file_put_contents($credentialsPath, $accessToken);
65 | printf("Credentials saved to %s\n", $credentialsPath);
66 | }
67 | $client->setAccessToken($accessToken);
68 |
69 | // Refresh the token if it's expired.
70 | if ($client->isAccessTokenExpired()) {
71 | $client->refreshToken($client->getRefreshToken());
72 | file_put_contents($credentialsPath, $client->getAccessToken());
73 | }
74 | return $client;
75 | }
76 |
77 | /**
78 | * Expands the home directory alias '~' to the full path.
79 | * @param string $path the path to expand.
80 | * @return string the expanded path.
81 | */
82 | function expandHomeDirectory($path) {
83 | $homeDirectory = getenv('HOME');
84 | if (empty($homeDirectory)) {
85 | $homeDirectory = getenv("HOMEDRIVE") . getenv("HOMEPATH");
86 | }
87 | return str_replace('~', realpath($homeDirectory), $path);
88 | }
89 |
90 | /**
91 | * Upload file to Goole Drive
92 | * @param string $fileName Name of file
93 | * @return void
94 | */
95 | function uploadFileToDrive($fileName)
96 | {
97 | // Get the API client and construct the service object.
98 | $client = getClient();
99 | $service = new Google_Service_Drive($client);
100 |
101 | $file = new Google_Service_Drive_DriveFile();
102 |
103 | $currentFile = __DIR__ . '/' . $fileName;
104 | $currentFileInfo = pathinfo($currentFile);
105 | $currentFileMime = mime_content_type($currentFile);
106 |
107 | // Set the metadata
108 | $file->setName($currentFileInfo['filename']);
109 | $file->setDescription( $currentFileInfo['filename'] . " is uploaded by automated system!" );
110 | $file->setMimeType($currentFileMime);
111 |
112 | $isDirectory = DIRECTORY_TO_SAVE;
113 | if ($isDirectory) {
114 | $file->setParents(array(DIRECTORY_TO_SAVE));
115 | }
116 |
117 | writeLog("Upload file to Google Drive Started");
118 |
119 | try {
120 | $createdFile = $service->files->create($file, array(
121 | 'data' => file_get_contents($currentFile),
122 | 'mimeType' => $currentFileMime,
123 | 'uploadType'=> 'multipart'
124 | ));
125 | } catch (\Exception $e) {
126 | writeLog("Upload canceled! We got an error! : " . $e->getMessage()); die;
127 | }
128 |
129 |
130 | writeLog("Upload file to Google Drive Finished");
131 |
132 | return $createdFile;
133 | }
134 |
135 | /**
136 | * Backup & Compress DB to BZip2
137 | * @return string Filename of DB.bz2
138 | */
139 | function backupDB() {
140 | $dumpSettings = array(
141 | 'compress' => 'Bzip2',
142 | );
143 | try {
144 | writeLog("Dumping & Compressing DB Started");
145 | $mysqlPath = __DIR__ . "/";
146 | $mysqlFile = 'MYSQL_DUMP_' . date('Y_m_d') . ".bz2";
147 | $dump = new IMysqldump\Mysqldump('mysql:host='. getenv('MYSQL_HOST') .';dbname=' . getenv('MYSQL_DB_NAME'), getenv('MYSQL_USER'), getenv('MYSQL_PASSWORD'), $dumpSettings);
148 | $dump->start($mysqlPath . $mysqlFile);
149 | writeLog("Dumping & Compressing DB Finished");
150 |
151 | return $mysqlFile;
152 | } catch (\Exception $e) {
153 | writeLog('mysqldump-php error: ' . $e->getMessage());
154 | echo 'mysqldump-php error: ' . $e->getMessage();
155 | }
156 | }
157 |
158 | function writeLog($message = "", $postToSlack = true) {
159 | if ($postToSlack) {
160 | postToSlack($message);
161 | }
162 |
163 | echo "[" . date('d-m-Y H:i:s') . "] " . $message . "\n";
164 | }
165 |
166 | /**
167 | * Post to Slack
168 | * @return void
169 | */
170 | function postToSlack($message)
171 | {
172 | if ((bool)getenv('SLACK') && trim($message)!=='') {
173 | $slack = new Maknz\Slack\Client(getenv('SLACK_URL'));
174 | $slack->send('*[BACKUP DB]* ' . $message);
175 | }
176 | }
177 |
178 | $mysqlFile = backupDB();
179 | uploadFileToDrive($mysqlFile);
180 |
181 | writeLog("Deleting local file!");
182 | unlink(__DIR__ . "/" . $mysqlFile);
183 | writeLog("Local file deleted");
184 | writeLog("=========================================================", false);
--------------------------------------------------------------------------------