1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service;
19
20use Google\Client;
21
22/**
23 * Service definition for Blogger (v3).
24 *
25 * <p>
26 * The Blogger API provides access to posts, comments and pages of a Blogger
27 * blog.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://developers.google.com/blogger/docs/3.0/getting_started" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class Blogger extends \Google\Service
37{
38  /** Manage your Blogger account. */
39  const BLOGGER =
40      "https://www.googleapis.com/auth/blogger";
41  /** View your Blogger account. */
42  const BLOGGER_READONLY =
43      "https://www.googleapis.com/auth/blogger.readonly";
44
45  public $blogUserInfos;
46  public $blogs;
47  public $comments;
48  public $pageViews;
49  public $pages;
50  public $postUserInfos;
51  public $posts;
52  public $users;
53
54  /**
55   * Constructs the internal representation of the Blogger service.
56   *
57   * @param Client|array $clientOrConfig The client used to deliver requests, or a
58   *                                     config array to pass to a new Client instance.
59   * @param string $rootUrl The root URL used for requests to the service.
60   */
61  public function __construct($clientOrConfig = [], $rootUrl = null)
62  {
63    parent::__construct($clientOrConfig);
64    $this->rootUrl = $rootUrl ?: 'https://blogger.googleapis.com/';
65    $this->servicePath = '';
66    $this->batchPath = 'batch';
67    $this->version = 'v3';
68    $this->serviceName = 'blogger';
69
70    $this->blogUserInfos = new Blogger\Resource\BlogUserInfos(
71        $this,
72        $this->serviceName,
73        'blogUserInfos',
74        [
75          'methods' => [
76            'get' => [
77              'path' => 'v3/users/{userId}/blogs/{blogId}',
78              'httpMethod' => 'GET',
79              'parameters' => [
80                'userId' => [
81                  'location' => 'path',
82                  'type' => 'string',
83                  'required' => true,
84                ],
85                'blogId' => [
86                  'location' => 'path',
87                  'type' => 'string',
88                  'required' => true,
89                ],
90                'maxPosts' => [
91                  'location' => 'query',
92                  'type' => 'integer',
93                ],
94              ],
95            ],
96          ]
97        ]
98    );
99    $this->blogs = new Blogger\Resource\Blogs(
100        $this,
101        $this->serviceName,
102        'blogs',
103        [
104          'methods' => [
105            'get' => [
106              'path' => 'v3/blogs/{blogId}',
107              'httpMethod' => 'GET',
108              'parameters' => [
109                'blogId' => [
110                  'location' => 'path',
111                  'type' => 'string',
112                  'required' => true,
113                ],
114                'maxPosts' => [
115                  'location' => 'query',
116                  'type' => 'integer',
117                ],
118                'view' => [
119                  'location' => 'query',
120                  'type' => 'string',
121                ],
122              ],
123            ],'getByUrl' => [
124              'path' => 'v3/blogs/byurl',
125              'httpMethod' => 'GET',
126              'parameters' => [
127                'url' => [
128                  'location' => 'query',
129                  'type' => 'string',
130                  'required' => true,
131                ],
132                'view' => [
133                  'location' => 'query',
134                  'type' => 'string',
135                ],
136              ],
137            ],'listByUser' => [
138              'path' => 'v3/users/{userId}/blogs',
139              'httpMethod' => 'GET',
140              'parameters' => [
141                'userId' => [
142                  'location' => 'path',
143                  'type' => 'string',
144                  'required' => true,
145                ],
146                'fetchUserInfo' => [
147                  'location' => 'query',
148                  'type' => 'boolean',
149                ],
150                'role' => [
151                  'location' => 'query',
152                  'type' => 'string',
153                  'repeated' => true,
154                ],
155                'status' => [
156                  'location' => 'query',
157                  'type' => 'string',
158                  'repeated' => true,
159                ],
160                'view' => [
161                  'location' => 'query',
162                  'type' => 'string',
163                ],
164              ],
165            ],
166          ]
167        ]
168    );
169    $this->comments = new Blogger\Resource\Comments(
170        $this,
171        $this->serviceName,
172        'comments',
173        [
174          'methods' => [
175            'approve' => [
176              'path' => 'v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/approve',
177              'httpMethod' => 'POST',
178              'parameters' => [
179                'blogId' => [
180                  'location' => 'path',
181                  'type' => 'string',
182                  'required' => true,
183                ],
184                'postId' => [
185                  'location' => 'path',
186                  'type' => 'string',
187                  'required' => true,
188                ],
189                'commentId' => [
190                  'location' => 'path',
191                  'type' => 'string',
192                  'required' => true,
193                ],
194              ],
195            ],'delete' => [
196              'path' => 'v3/blogs/{blogId}/posts/{postId}/comments/{commentId}',
197              'httpMethod' => 'DELETE',
198              'parameters' => [
199                'blogId' => [
200                  'location' => 'path',
201                  'type' => 'string',
202                  'required' => true,
203                ],
204                'postId' => [
205                  'location' => 'path',
206                  'type' => 'string',
207                  'required' => true,
208                ],
209                'commentId' => [
210                  'location' => 'path',
211                  'type' => 'string',
212                  'required' => true,
213                ],
214              ],
215            ],'get' => [
216              'path' => 'v3/blogs/{blogId}/posts/{postId}/comments/{commentId}',
217              'httpMethod' => 'GET',
218              'parameters' => [
219                'blogId' => [
220                  'location' => 'path',
221                  'type' => 'string',
222                  'required' => true,
223                ],
224                'postId' => [
225                  'location' => 'path',
226                  'type' => 'string',
227                  'required' => true,
228                ],
229                'commentId' => [
230                  'location' => 'path',
231                  'type' => 'string',
232                  'required' => true,
233                ],
234                'view' => [
235                  'location' => 'query',
236                  'type' => 'string',
237                ],
238              ],
239            ],'list' => [
240              'path' => 'v3/blogs/{blogId}/posts/{postId}/comments',
241              'httpMethod' => 'GET',
242              'parameters' => [
243                'blogId' => [
244                  'location' => 'path',
245                  'type' => 'string',
246                  'required' => true,
247                ],
248                'postId' => [
249                  'location' => 'path',
250                  'type' => 'string',
251                  'required' => true,
252                ],
253                'endDate' => [
254                  'location' => 'query',
255                  'type' => 'string',
256                ],
257                'fetchBodies' => [
258                  'location' => 'query',
259                  'type' => 'boolean',
260                ],
261                'maxResults' => [
262                  'location' => 'query',
263                  'type' => 'integer',
264                ],
265                'pageToken' => [
266                  'location' => 'query',
267                  'type' => 'string',
268                ],
269                'startDate' => [
270                  'location' => 'query',
271                  'type' => 'string',
272                ],
273                'status' => [
274                  'location' => 'query',
275                  'type' => 'string',
276                ],
277                'view' => [
278                  'location' => 'query',
279                  'type' => 'string',
280                ],
281              ],
282            ],'listByBlog' => [
283              'path' => 'v3/blogs/{blogId}/comments',
284              'httpMethod' => 'GET',
285              'parameters' => [
286                'blogId' => [
287                  'location' => 'path',
288                  'type' => 'string',
289                  'required' => true,
290                ],
291                'endDate' => [
292                  'location' => 'query',
293                  'type' => 'string',
294                ],
295                'fetchBodies' => [
296                  'location' => 'query',
297                  'type' => 'boolean',
298                ],
299                'maxResults' => [
300                  'location' => 'query',
301                  'type' => 'integer',
302                ],
303                'pageToken' => [
304                  'location' => 'query',
305                  'type' => 'string',
306                ],
307                'startDate' => [
308                  'location' => 'query',
309                  'type' => 'string',
310                ],
311                'status' => [
312                  'location' => 'query',
313                  'type' => 'string',
314                  'repeated' => true,
315                ],
316              ],
317            ],'markAsSpam' => [
318              'path' => 'v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/spam',
319              'httpMethod' => 'POST',
320              'parameters' => [
321                'blogId' => [
322                  'location' => 'path',
323                  'type' => 'string',
324                  'required' => true,
325                ],
326                'postId' => [
327                  'location' => 'path',
328                  'type' => 'string',
329                  'required' => true,
330                ],
331                'commentId' => [
332                  'location' => 'path',
333                  'type' => 'string',
334                  'required' => true,
335                ],
336              ],
337            ],'removeContent' => [
338              'path' => 'v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent',
339              'httpMethod' => 'POST',
340              'parameters' => [
341                'blogId' => [
342                  'location' => 'path',
343                  'type' => 'string',
344                  'required' => true,
345                ],
346                'postId' => [
347                  'location' => 'path',
348                  'type' => 'string',
349                  'required' => true,
350                ],
351                'commentId' => [
352                  'location' => 'path',
353                  'type' => 'string',
354                  'required' => true,
355                ],
356              ],
357            ],
358          ]
359        ]
360    );
361    $this->pageViews = new Blogger\Resource\PageViews(
362        $this,
363        $this->serviceName,
364        'pageViews',
365        [
366          'methods' => [
367            'get' => [
368              'path' => 'v3/blogs/{blogId}/pageviews',
369              'httpMethod' => 'GET',
370              'parameters' => [
371                'blogId' => [
372                  'location' => 'path',
373                  'type' => 'string',
374                  'required' => true,
375                ],
376                'range' => [
377                  'location' => 'query',
378                  'type' => 'string',
379                  'repeated' => true,
380                ],
381              ],
382            ],
383          ]
384        ]
385    );
386    $this->pages = new Blogger\Resource\Pages(
387        $this,
388        $this->serviceName,
389        'pages',
390        [
391          'methods' => [
392            'delete' => [
393              'path' => 'v3/blogs/{blogId}/pages/{pageId}',
394              'httpMethod' => 'DELETE',
395              'parameters' => [
396                'blogId' => [
397                  'location' => 'path',
398                  'type' => 'string',
399                  'required' => true,
400                ],
401                'pageId' => [
402                  'location' => 'path',
403                  'type' => 'string',
404                  'required' => true,
405                ],
406              ],
407            ],'get' => [
408              'path' => 'v3/blogs/{blogId}/pages/{pageId}',
409              'httpMethod' => 'GET',
410              'parameters' => [
411                'blogId' => [
412                  'location' => 'path',
413                  'type' => 'string',
414                  'required' => true,
415                ],
416                'pageId' => [
417                  'location' => 'path',
418                  'type' => 'string',
419                  'required' => true,
420                ],
421                'view' => [
422                  'location' => 'query',
423                  'type' => 'string',
424                ],
425              ],
426            ],'insert' => [
427              'path' => 'v3/blogs/{blogId}/pages',
428              'httpMethod' => 'POST',
429              'parameters' => [
430                'blogId' => [
431                  'location' => 'path',
432                  'type' => 'string',
433                  'required' => true,
434                ],
435                'isDraft' => [
436                  'location' => 'query',
437                  'type' => 'boolean',
438                ],
439              ],
440            ],'list' => [
441              'path' => 'v3/blogs/{blogId}/pages',
442              'httpMethod' => 'GET',
443              'parameters' => [
444                'blogId' => [
445                  'location' => 'path',
446                  'type' => 'string',
447                  'required' => true,
448                ],
449                'fetchBodies' => [
450                  'location' => 'query',
451                  'type' => 'boolean',
452                ],
453                'maxResults' => [
454                  'location' => 'query',
455                  'type' => 'integer',
456                ],
457                'pageToken' => [
458                  'location' => 'query',
459                  'type' => 'string',
460                ],
461                'status' => [
462                  'location' => 'query',
463                  'type' => 'string',
464                  'repeated' => true,
465                ],
466                'view' => [
467                  'location' => 'query',
468                  'type' => 'string',
469                ],
470              ],
471            ],'patch' => [
472              'path' => 'v3/blogs/{blogId}/pages/{pageId}',
473              'httpMethod' => 'PATCH',
474              'parameters' => [
475                'blogId' => [
476                  'location' => 'path',
477                  'type' => 'string',
478                  'required' => true,
479                ],
480                'pageId' => [
481                  'location' => 'path',
482                  'type' => 'string',
483                  'required' => true,
484                ],
485                'publish' => [
486                  'location' => 'query',
487                  'type' => 'boolean',
488                ],
489                'revert' => [
490                  'location' => 'query',
491                  'type' => 'boolean',
492                ],
493              ],
494            ],'publish' => [
495              'path' => 'v3/blogs/{blogId}/pages/{pageId}/publish',
496              'httpMethod' => 'POST',
497              'parameters' => [
498                'blogId' => [
499                  'location' => 'path',
500                  'type' => 'string',
501                  'required' => true,
502                ],
503                'pageId' => [
504                  'location' => 'path',
505                  'type' => 'string',
506                  'required' => true,
507                ],
508              ],
509            ],'revert' => [
510              'path' => 'v3/blogs/{blogId}/pages/{pageId}/revert',
511              'httpMethod' => 'POST',
512              'parameters' => [
513                'blogId' => [
514                  'location' => 'path',
515                  'type' => 'string',
516                  'required' => true,
517                ],
518                'pageId' => [
519                  'location' => 'path',
520                  'type' => 'string',
521                  'required' => true,
522                ],
523              ],
524            ],'update' => [
525              'path' => 'v3/blogs/{blogId}/pages/{pageId}',
526              'httpMethod' => 'PUT',
527              'parameters' => [
528                'blogId' => [
529                  'location' => 'path',
530                  'type' => 'string',
531                  'required' => true,
532                ],
533                'pageId' => [
534                  'location' => 'path',
535                  'type' => 'string',
536                  'required' => true,
537                ],
538                'publish' => [
539                  'location' => 'query',
540                  'type' => 'boolean',
541                ],
542                'revert' => [
543                  'location' => 'query',
544                  'type' => 'boolean',
545                ],
546              ],
547            ],
548          ]
549        ]
550    );
551    $this->postUserInfos = new Blogger\Resource\PostUserInfos(
552        $this,
553        $this->serviceName,
554        'postUserInfos',
555        [
556          'methods' => [
557            'get' => [
558              'path' => 'v3/users/{userId}/blogs/{blogId}/posts/{postId}',
559              'httpMethod' => 'GET',
560              'parameters' => [
561                'userId' => [
562                  'location' => 'path',
563                  'type' => 'string',
564                  'required' => true,
565                ],
566                'blogId' => [
567                  'location' => 'path',
568                  'type' => 'string',
569                  'required' => true,
570                ],
571                'postId' => [
572                  'location' => 'path',
573                  'type' => 'string',
574                  'required' => true,
575                ],
576                'maxComments' => [
577                  'location' => 'query',
578                  'type' => 'integer',
579                ],
580              ],
581            ],'list' => [
582              'path' => 'v3/users/{userId}/blogs/{blogId}/posts',
583              'httpMethod' => 'GET',
584              'parameters' => [
585                'userId' => [
586                  'location' => 'path',
587                  'type' => 'string',
588                  'required' => true,
589                ],
590                'blogId' => [
591                  'location' => 'path',
592                  'type' => 'string',
593                  'required' => true,
594                ],
595                'endDate' => [
596                  'location' => 'query',
597                  'type' => 'string',
598                ],
599                'fetchBodies' => [
600                  'location' => 'query',
601                  'type' => 'boolean',
602                ],
603                'labels' => [
604                  'location' => 'query',
605                  'type' => 'string',
606                ],
607                'maxResults' => [
608                  'location' => 'query',
609                  'type' => 'integer',
610                ],
611                'orderBy' => [
612                  'location' => 'query',
613                  'type' => 'string',
614                ],
615                'pageToken' => [
616                  'location' => 'query',
617                  'type' => 'string',
618                ],
619                'startDate' => [
620                  'location' => 'query',
621                  'type' => 'string',
622                ],
623                'status' => [
624                  'location' => 'query',
625                  'type' => 'string',
626                  'repeated' => true,
627                ],
628                'view' => [
629                  'location' => 'query',
630                  'type' => 'string',
631                ],
632              ],
633            ],
634          ]
635        ]
636    );
637    $this->posts = new Blogger\Resource\Posts(
638        $this,
639        $this->serviceName,
640        'posts',
641        [
642          'methods' => [
643            'delete' => [
644              'path' => 'v3/blogs/{blogId}/posts/{postId}',
645              'httpMethod' => 'DELETE',
646              'parameters' => [
647                'blogId' => [
648                  'location' => 'path',
649                  'type' => 'string',
650                  'required' => true,
651                ],
652                'postId' => [
653                  'location' => 'path',
654                  'type' => 'string',
655                  'required' => true,
656                ],
657              ],
658            ],'get' => [
659              'path' => 'v3/blogs/{blogId}/posts/{postId}',
660              'httpMethod' => 'GET',
661              'parameters' => [
662                'blogId' => [
663                  'location' => 'path',
664                  'type' => 'string',
665                  'required' => true,
666                ],
667                'postId' => [
668                  'location' => 'path',
669                  'type' => 'string',
670                  'required' => true,
671                ],
672                'fetchBody' => [
673                  'location' => 'query',
674                  'type' => 'boolean',
675                ],
676                'fetchImages' => [
677                  'location' => 'query',
678                  'type' => 'boolean',
679                ],
680                'maxComments' => [
681                  'location' => 'query',
682                  'type' => 'integer',
683                ],
684                'view' => [
685                  'location' => 'query',
686                  'type' => 'string',
687                ],
688              ],
689            ],'getByPath' => [
690              'path' => 'v3/blogs/{blogId}/posts/bypath',
691              'httpMethod' => 'GET',
692              'parameters' => [
693                'blogId' => [
694                  'location' => 'path',
695                  'type' => 'string',
696                  'required' => true,
697                ],
698                'path' => [
699                  'location' => 'query',
700                  'type' => 'string',
701                  'required' => true,
702                ],
703                'maxComments' => [
704                  'location' => 'query',
705                  'type' => 'integer',
706                ],
707                'view' => [
708                  'location' => 'query',
709                  'type' => 'string',
710                ],
711              ],
712            ],'insert' => [
713              'path' => 'v3/blogs/{blogId}/posts',
714              'httpMethod' => 'POST',
715              'parameters' => [
716                'blogId' => [
717                  'location' => 'path',
718                  'type' => 'string',
719                  'required' => true,
720                ],
721                'fetchBody' => [
722                  'location' => 'query',
723                  'type' => 'boolean',
724                ],
725                'fetchImages' => [
726                  'location' => 'query',
727                  'type' => 'boolean',
728                ],
729                'isDraft' => [
730                  'location' => 'query',
731                  'type' => 'boolean',
732                ],
733              ],
734            ],'list' => [
735              'path' => 'v3/blogs/{blogId}/posts',
736              'httpMethod' => 'GET',
737              'parameters' => [
738                'blogId' => [
739                  'location' => 'path',
740                  'type' => 'string',
741                  'required' => true,
742                ],
743                'endDate' => [
744                  'location' => 'query',
745                  'type' => 'string',
746                ],
747                'fetchBodies' => [
748                  'location' => 'query',
749                  'type' => 'boolean',
750                ],
751                'fetchImages' => [
752                  'location' => 'query',
753                  'type' => 'boolean',
754                ],
755                'labels' => [
756                  'location' => 'query',
757                  'type' => 'string',
758                ],
759                'maxResults' => [
760                  'location' => 'query',
761                  'type' => 'integer',
762                ],
763                'orderBy' => [
764                  'location' => 'query',
765                  'type' => 'string',
766                ],
767                'pageToken' => [
768                  'location' => 'query',
769                  'type' => 'string',
770                ],
771                'startDate' => [
772                  'location' => 'query',
773                  'type' => 'string',
774                ],
775                'status' => [
776                  'location' => 'query',
777                  'type' => 'string',
778                  'repeated' => true,
779                ],
780                'view' => [
781                  'location' => 'query',
782                  'type' => 'string',
783                ],
784              ],
785            ],'patch' => [
786              'path' => 'v3/blogs/{blogId}/posts/{postId}',
787              'httpMethod' => 'PATCH',
788              'parameters' => [
789                'blogId' => [
790                  'location' => 'path',
791                  'type' => 'string',
792                  'required' => true,
793                ],
794                'postId' => [
795                  'location' => 'path',
796                  'type' => 'string',
797                  'required' => true,
798                ],
799                'fetchBody' => [
800                  'location' => 'query',
801                  'type' => 'boolean',
802                ],
803                'fetchImages' => [
804                  'location' => 'query',
805                  'type' => 'boolean',
806                ],
807                'maxComments' => [
808                  'location' => 'query',
809                  'type' => 'integer',
810                ],
811                'publish' => [
812                  'location' => 'query',
813                  'type' => 'boolean',
814                ],
815                'revert' => [
816                  'location' => 'query',
817                  'type' => 'boolean',
818                ],
819              ],
820            ],'publish' => [
821              'path' => 'v3/blogs/{blogId}/posts/{postId}/publish',
822              'httpMethod' => 'POST',
823              'parameters' => [
824                'blogId' => [
825                  'location' => 'path',
826                  'type' => 'string',
827                  'required' => true,
828                ],
829                'postId' => [
830                  'location' => 'path',
831                  'type' => 'string',
832                  'required' => true,
833                ],
834                'publishDate' => [
835                  'location' => 'query',
836                  'type' => 'string',
837                ],
838              ],
839            ],'revert' => [
840              'path' => 'v3/blogs/{blogId}/posts/{postId}/revert',
841              'httpMethod' => 'POST',
842              'parameters' => [
843                'blogId' => [
844                  'location' => 'path',
845                  'type' => 'string',
846                  'required' => true,
847                ],
848                'postId' => [
849                  'location' => 'path',
850                  'type' => 'string',
851                  'required' => true,
852                ],
853              ],
854            ],'search' => [
855              'path' => 'v3/blogs/{blogId}/posts/search',
856              'httpMethod' => 'GET',
857              'parameters' => [
858                'blogId' => [
859                  'location' => 'path',
860                  'type' => 'string',
861                  'required' => true,
862                ],
863                'q' => [
864                  'location' => 'query',
865                  'type' => 'string',
866                  'required' => true,
867                ],
868                'fetchBodies' => [
869                  'location' => 'query',
870                  'type' => 'boolean',
871                ],
872                'orderBy' => [
873                  'location' => 'query',
874                  'type' => 'string',
875                ],
876              ],
877            ],'update' => [
878              'path' => 'v3/blogs/{blogId}/posts/{postId}',
879              'httpMethod' => 'PUT',
880              'parameters' => [
881                'blogId' => [
882                  'location' => 'path',
883                  'type' => 'string',
884                  'required' => true,
885                ],
886                'postId' => [
887                  'location' => 'path',
888                  'type' => 'string',
889                  'required' => true,
890                ],
891                'fetchBody' => [
892                  'location' => 'query',
893                  'type' => 'boolean',
894                ],
895                'fetchImages' => [
896                  'location' => 'query',
897                  'type' => 'boolean',
898                ],
899                'maxComments' => [
900                  'location' => 'query',
901                  'type' => 'integer',
902                ],
903                'publish' => [
904                  'location' => 'query',
905                  'type' => 'boolean',
906                ],
907                'revert' => [
908                  'location' => 'query',
909                  'type' => 'boolean',
910                ],
911              ],
912            ],
913          ]
914        ]
915    );
916    $this->users = new Blogger\Resource\Users(
917        $this,
918        $this->serviceName,
919        'users',
920        [
921          'methods' => [
922            'get' => [
923              'path' => 'v3/users/{userId}',
924              'httpMethod' => 'GET',
925              'parameters' => [
926                'userId' => [
927                  'location' => 'path',
928                  'type' => 'string',
929                  'required' => true,
930                ],
931              ],
932            ],
933          ]
934        ]
935    );
936  }
937}
938
939// Adding a class alias for backwards compatibility with the previous class name.
940class_alias(Blogger::class, 'Google_Service_Blogger');
941