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\GoogleCloudApigeeV1CustomReport;
21use Google\Service\Apigee\GoogleCloudApigeeV1DeleteCustomReportResponse;
22use Google\Service\Apigee\GoogleCloudApigeeV1ListCustomReportsResponse;
23
24/**
25 * The "reports" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $apigeeService = new Google\Service\Apigee(...);
29 *   $reports = $apigeeService->reports;
30 *  </code>
31 */
32class OrganizationsReports extends \Google\Service\Resource
33{
34  /**
35   * Creates a Custom Report for an Organization. A Custom Report provides Apigee
36   * Customers to create custom dashboards in addition to the standard dashboards
37   * which are provided. The Custom Report in its simplest form contains
38   * specifications about metrics, dimensions and filters. It is important to note
39   * that the custom report by itself does not provide an executable entity. The
40   * Edge UI converts the custom report definition into an analytics query and
41   * displays the result in a chart. (reports.create)
42   *
43   * @param string $parent Required. The parent organization name under which the
44   * Custom Report will be created. Must be of the form:
45   * `organizations/{organization_id}/reports`
46   * @param GoogleCloudApigeeV1CustomReport $postBody
47   * @param array $optParams Optional parameters.
48   * @return GoogleCloudApigeeV1CustomReport
49   */
50  public function create($parent, GoogleCloudApigeeV1CustomReport $postBody, $optParams = [])
51  {
52    $params = ['parent' => $parent, 'postBody' => $postBody];
53    $params = array_merge($params, $optParams);
54    return $this->call('create', [$params], GoogleCloudApigeeV1CustomReport::class);
55  }
56  /**
57   * Deletes an existing custom report definition (reports.delete)
58   *
59   * @param string $name Required. Custom Report name of the form:
60   * `organizations/{organization_id}/reports/{report_name}`
61   * @param array $optParams Optional parameters.
62   * @return GoogleCloudApigeeV1DeleteCustomReportResponse
63   */
64  public function delete($name, $optParams = [])
65  {
66    $params = ['name' => $name];
67    $params = array_merge($params, $optParams);
68    return $this->call('delete', [$params], GoogleCloudApigeeV1DeleteCustomReportResponse::class);
69  }
70  /**
71   * Retrieve a custom report definition. (reports.get)
72   *
73   * @param string $name Required. Custom Report name of the form:
74   * `organizations/{organization_id}/reports/{report_name}`
75   * @param array $optParams Optional parameters.
76   * @return GoogleCloudApigeeV1CustomReport
77   */
78  public function get($name, $optParams = [])
79  {
80    $params = ['name' => $name];
81    $params = array_merge($params, $optParams);
82    return $this->call('get', [$params], GoogleCloudApigeeV1CustomReport::class);
83  }
84  /**
85   * Return a list of Custom Reports (reports.listOrganizationsReports)
86   *
87   * @param string $parent Required. The parent organization name under which the
88   * API product will be listed `organizations/{organization_id}/reports`
89   * @param array $optParams Optional parameters.
90   *
91   * @opt_param bool expand Set to 'true' to get expanded details about each
92   * custom report.
93   * @return GoogleCloudApigeeV1ListCustomReportsResponse
94   */
95  public function listOrganizationsReports($parent, $optParams = [])
96  {
97    $params = ['parent' => $parent];
98    $params = array_merge($params, $optParams);
99    return $this->call('list', [$params], GoogleCloudApigeeV1ListCustomReportsResponse::class);
100  }
101  /**
102   * Update an existing custom report definition (reports.update)
103   *
104   * @param string $name Required. Custom Report name of the form:
105   * `organizations/{organization_id}/reports/{report_name}`
106   * @param GoogleCloudApigeeV1CustomReport $postBody
107   * @param array $optParams Optional parameters.
108   * @return GoogleCloudApigeeV1CustomReport
109   */
110  public function update($name, GoogleCloudApigeeV1CustomReport $postBody, $optParams = [])
111  {
112    $params = ['name' => $name, 'postBody' => $postBody];
113    $params = array_merge($params, $optParams);
114    return $this->call('update', [$params], GoogleCloudApigeeV1CustomReport::class);
115  }
116}
117
118// Adding a class alias for backwards compatibility with the previous class name.
119class_alias(OrganizationsReports::class, 'Google_Service_Apigee_Resource_OrganizationsReports');
120