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\Apigee\Resource;
19
20use Google\Service\Apigee\GoogleCloudApigeeV1ApiCategory;
21use Google\Service\Apigee\GoogleCloudApigeeV1ApiCategoryData;
22use Google\Service\Apigee\GoogleCloudApigeeV1ApiResponseWrapper;
23use Google\Service\Apigee\GoogleCloudApigeeV1ListApiCategoriesResponse;
24
25/**
26 * The "apicategories" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $apigeeService = new Google\Service\Apigee(...);
30 *   $apicategories = $apigeeService->apicategories;
31 *  </code>
32 */
33class OrganizationsSitesApicategories extends \Google\Service\Resource
34{
35  /**
36   * Creates a new category on the portal. (apicategories.create)
37   *
38   * @param string $parent Required. Name of the portal. Use the following
39   * structure in your request: `organizations/{org}/sites/{site}`
40   * @param GoogleCloudApigeeV1ApiCategoryData $postBody
41   * @param array $optParams Optional parameters.
42   * @return GoogleCloudApigeeV1ApiCategory
43   */
44  public function create($parent, GoogleCloudApigeeV1ApiCategoryData $postBody, $optParams = [])
45  {
46    $params = ['parent' => $parent, 'postBody' => $postBody];
47    $params = array_merge($params, $optParams);
48    return $this->call('create', [$params], GoogleCloudApigeeV1ApiCategory::class);
49  }
50  /**
51   * Deletes a category from the portal. (apicategories.delete)
52   *
53   * @param string $name Required. Name of the category. Use the following
54   * structure in your request:
55   * `organizations/{org}/sites/{site}/apicategories/{apicategory}`
56   * @param array $optParams Optional parameters.
57   * @return GoogleCloudApigeeV1ApiResponseWrapper
58   */
59  public function delete($name, $optParams = [])
60  {
61    $params = ['name' => $name];
62    $params = array_merge($params, $optParams);
63    return $this->call('delete', [$params], GoogleCloudApigeeV1ApiResponseWrapper::class);
64  }
65  /**
66   * Gets a category on the portal. (apicategories.get)
67   *
68   * @param string $name Required. Name of the category. Use the following
69   * structure in your request:
70   * `organizations/{org}/sites/{site}/apicategories/{apicategory}`
71   * @param array $optParams Optional parameters.
72   * @return GoogleCloudApigeeV1ApiCategory
73   */
74  public function get($name, $optParams = [])
75  {
76    $params = ['name' => $name];
77    $params = array_merge($params, $optParams);
78    return $this->call('get', [$params], GoogleCloudApigeeV1ApiCategory::class);
79  }
80  /**
81   * Lists the categories on the portal.
82   * (apicategories.listOrganizationsSitesApicategories)
83   *
84   * @param string $parent Required. Name of the portal. Use the following
85   * structure in your request: `organizations/{org}/sites/{site}`
86   * @param array $optParams Optional parameters.
87   * @return GoogleCloudApigeeV1ListApiCategoriesResponse
88   */
89  public function listOrganizationsSitesApicategories($parent, $optParams = [])
90  {
91    $params = ['parent' => $parent];
92    $params = array_merge($params, $optParams);
93    return $this->call('list', [$params], GoogleCloudApigeeV1ListApiCategoriesResponse::class);
94  }
95  /**
96   * Updates a category on the portal. (apicategories.patch)
97   *
98   * @param string $name Required. Name of the category. Use the following
99   * structure in your request:
100   * `organizations/{org}/sites/{site}/apicategories/{apicategory}`
101   * @param GoogleCloudApigeeV1ApiCategoryData $postBody
102   * @param array $optParams Optional parameters.
103   * @return GoogleCloudApigeeV1ApiCategory
104   */
105  public function patch($name, GoogleCloudApigeeV1ApiCategoryData $postBody, $optParams = [])
106  {
107    $params = ['name' => $name, 'postBody' => $postBody];
108    $params = array_merge($params, $optParams);
109    return $this->call('patch', [$params], GoogleCloudApigeeV1ApiCategory::class);
110  }
111}
112
113// Adding a class alias for backwards compatibility with the previous class name.
114class_alias(OrganizationsSitesApicategories::class, 'Google_Service_Apigee_Resource_OrganizationsSitesApicategories');
115