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\VMMigrationService\Resource;
19
20use Google\Service\VMMigrationService\ListUtilizationReportsResponse;
21use Google\Service\VMMigrationService\Operation;
22use Google\Service\VMMigrationService\UtilizationReport;
23
24/**
25 * The "utilizationReports" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $vmmigrationService = new Google\Service\VMMigrationService(...);
29 *   $utilizationReports = $vmmigrationService->utilizationReports;
30 *  </code>
31 */
32class ProjectsLocationsSourcesUtilizationReports extends \Google\Service\Resource
33{
34  /**
35   * Creates a new UtilizationReport. (utilizationReports.create)
36   *
37   * @param string $parent Required. The Utilization Report's parent.
38   * @param UtilizationReport $postBody
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param string requestId A request ID to identify requests. Specify a
42   * unique request ID so that if you must retry your request, the server will
43   * know to ignore the request if it has already been completed. The server will
44   * guarantee that for at least 60 minutes since the first request. For example,
45   * consider a situation where you make an initial request and t he request times
46   * out. If you make the request again with the same request ID, the server can
47   * check if original operation with the same request ID was received, and if so,
48   * will ignore the second request. This prevents clients from accidentally
49   * creating duplicate commitments. The request ID must be a valid UUID with the
50   * exception that zero UUID is not supported
51   * (00000000-0000-0000-0000-000000000000).
52   * @opt_param string utilizationReportId Required. The ID to use for the report,
53   * which will become the final component of the reports's resource name. This
54   * value maximum length is 63 characters, and valid characters are /a-z-/. It
55   * must start with an english letter and must not end with a hyphen.
56   * @return Operation
57   */
58  public function create($parent, UtilizationReport $postBody, $optParams = [])
59  {
60    $params = ['parent' => $parent, 'postBody' => $postBody];
61    $params = array_merge($params, $optParams);
62    return $this->call('create', [$params], Operation::class);
63  }
64  /**
65   * Deletes a single Utilization Report. (utilizationReports.delete)
66   *
67   * @param string $name Required. The Utilization Report name.
68   * @param array $optParams Optional parameters.
69   *
70   * @opt_param string requestId Optional. A request ID to identify requests.
71   * Specify a unique request ID so that if you must retry your request, the
72   * server will know to ignore the request if it has already been completed. The
73   * server will guarantee that for at least 60 minutes after the first request.
74   * For example, consider a situation where you make an initial request and t he
75   * request times out. If you make the request again with the same request ID,
76   * the server can check if original operation with the same request ID was
77   * received, and if so, will ignore the second request. This prevents clients
78   * from accidentally creating duplicate commitments. The request ID must be a
79   * valid UUID with the exception that zero UUID is not supported
80   * (00000000-0000-0000-0000-000000000000).
81   * @return Operation
82   */
83  public function delete($name, $optParams = [])
84  {
85    $params = ['name' => $name];
86    $params = array_merge($params, $optParams);
87    return $this->call('delete', [$params], Operation::class);
88  }
89  /**
90   * Gets a single Utilization Report. (utilizationReports.get)
91   *
92   * @param string $name Required. The Utilization Report name.
93   * @param array $optParams Optional parameters.
94   *
95   * @opt_param string view Optional. The level of details of the report. Defaults
96   * to FULL
97   * @return UtilizationReport
98   */
99  public function get($name, $optParams = [])
100  {
101    $params = ['name' => $name];
102    $params = array_merge($params, $optParams);
103    return $this->call('get', [$params], UtilizationReport::class);
104  }
105  /**
106   * Lists Utilization Reports of the given Source.
107   * (utilizationReports.listProjectsLocationsSourcesUtilizationReports)
108   *
109   * @param string $parent Required. The Utilization Reports parent.
110   * @param array $optParams Optional parameters.
111   *
112   * @opt_param string filter Optional. The filter request.
113   * @opt_param string orderBy Optional. the order by fields for the result.
114   * @opt_param int pageSize Optional. The maximum number of reports to return.
115   * The service may return fewer than this value. If unspecified, at most 500
116   * reports will be returned. The maximum value is 1000; values above 1000 will
117   * be coerced to 1000.
118   * @opt_param string pageToken Required. A page token, received from a previous
119   * `ListUtilizationReports` call. Provide this to retrieve the subsequent page.
120   * When paginating, all other parameters provided to `ListUtilizationReports`
121   * must match the call that provided the page token.
122   * @opt_param string view Optional. The level of details of each report.
123   * Defaults to BASIC.
124   * @return ListUtilizationReportsResponse
125   */
126  public function listProjectsLocationsSourcesUtilizationReports($parent, $optParams = [])
127  {
128    $params = ['parent' => $parent];
129    $params = array_merge($params, $optParams);
130    return $this->call('list', [$params], ListUtilizationReportsResponse::class);
131  }
132}
133
134// Adding a class alias for backwards compatibility with the previous class name.
135class_alias(ProjectsLocationsSourcesUtilizationReports::class, 'Google_Service_VMMigrationService_Resource_ProjectsLocationsSourcesUtilizationReports');
136