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\Blogger\Resource;
19
20use Google\Service\Blogger\Blog;
21use Google\Service\Blogger\BlogList;
22
23/**
24 * The "blogs" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $bloggerService = new Google\Service\Blogger(...);
28 *   $blogs = $bloggerService->blogs;
29 *  </code>
30 */
31class Blogs extends \Google\Service\Resource
32{
33  /**
34   * Gets a blog by id. (blogs.get)
35   *
36   * @param string $blogId
37   * @param array $optParams Optional parameters.
38   *
39   * @opt_param string maxPosts
40   * @opt_param string view
41   * @return Blog
42   */
43  public function get($blogId, $optParams = [])
44  {
45    $params = ['blogId' => $blogId];
46    $params = array_merge($params, $optParams);
47    return $this->call('get', [$params], Blog::class);
48  }
49  /**
50   * Gets a blog by url. (blogs.getByUrl)
51   *
52   * @param string $url
53   * @param array $optParams Optional parameters.
54   *
55   * @opt_param string view
56   * @return Blog
57   */
58  public function getByUrl($url, $optParams = [])
59  {
60    $params = ['url' => $url];
61    $params = array_merge($params, $optParams);
62    return $this->call('getByUrl', [$params], Blog::class);
63  }
64  /**
65   * Lists blogs by user. (blogs.listByUser)
66   *
67   * @param string $userId
68   * @param array $optParams Optional parameters.
69   *
70   * @opt_param bool fetchUserInfo
71   * @opt_param string role
72   * @opt_param string status Default value of status is LIVE.
73   * @opt_param string view
74   * @return BlogList
75   */
76  public function listByUser($userId, $optParams = [])
77  {
78    $params = ['userId' => $userId];
79    $params = array_merge($params, $optParams);
80    return $this->call('listByUser', [$params], BlogList::class);
81  }
82}
83
84// Adding a class alias for backwards compatibility with the previous class name.
85class_alias(Blogs::class, 'Google_Service_Blogger_Resource_Blogs');
86