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\Compute\Resource;
19
20use Google\Service\Compute\DiskType;
21use Google\Service\Compute\RegionDiskTypeList;
22
23/**
24 * The "regionDiskTypes" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $computeService = new Google\Service\Compute(...);
28 *   $regionDiskTypes = $computeService->regionDiskTypes;
29 *  </code>
30 */
31class RegionDiskTypes extends \Google\Service\Resource
32{
33  /**
34   * Returns the specified regional disk type. Gets a list of available disk types
35   * by making a list() request. (regionDiskTypes.get)
36   *
37   * @param string $project Project ID for this request.
38   * @param string $region The name of the region for this request.
39   * @param string $diskType Name of the disk type to return.
40   * @param array $optParams Optional parameters.
41   * @return DiskType
42   */
43  public function get($project, $region, $diskType, $optParams = [])
44  {
45    $params = ['project' => $project, 'region' => $region, 'diskType' => $diskType];
46    $params = array_merge($params, $optParams);
47    return $this->call('get', [$params], DiskType::class);
48  }
49  /**
50   * Retrieves a list of regional disk types available to the specified project.
51   * (regionDiskTypes.listRegionDiskTypes)
52   *
53   * @param string $project Project ID for this request.
54   * @param string $region The name of the region for this request.
55   * @param array $optParams Optional parameters.
56   *
57   * @opt_param string filter A filter expression that filters resources listed in
58   * the response. The expression must specify the field name, an operator, and
59   * the value that you want to use for filtering. The value must be a string, a
60   * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
61   * `>=` or `:`. For example, if you are filtering Compute Engine instances, you
62   * can exclude instances named `example-instance` by specifying `name !=
63   * example-instance`. The `:` operator can be used with string fields to match
64   * substrings. For non-string fields it is equivalent to the `=` operator. The
65   * `:*` comparison can be used to test whether a key has been defined. For
66   * example, to find all objects with `owner` label use: ``` labels.owner:* ```
67   * You can also filter nested fields. For example, you could specify
68   * `scheduling.automaticRestart = false` to include instances only if they are
69   * not scheduled for automatic restarts. You can use filtering on nested fields
70   * to filter based on resource labels. To filter on multiple expressions,
71   * provide each separate expression within parentheses. For example: ```
72   * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
73   * default, each expression is an `AND` expression. However, you can include
74   * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
75   * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
76   * (scheduling.automaticRestart = true) ```
77   * @opt_param string maxResults The maximum number of results per page that
78   * should be returned. If the number of available results is larger than
79   * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
80   * get the next page of results in subsequent list requests. Acceptable values
81   * are `0` to `500`, inclusive. (Default: `500`)
82   * @opt_param string orderBy Sorts list results by a certain order. By default,
83   * results are returned in alphanumerical order based on the resource name. You
84   * can also sort results in descending order based on the creation timestamp
85   * using `orderBy="creationTimestamp desc"`. This sorts results based on the
86   * `creationTimestamp` field in reverse chronological order (newest result
87   * first). Use this to sort resources like operations so that the newest
88   * operation is returned first. Currently, only sorting by `name` or
89   * `creationTimestamp desc` is supported.
90   * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
91   * the `nextPageToken` returned by a previous list request to get the next page
92   * of results.
93   * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
94   * which provides partial results in case of failure. The default value is
95   * false.
96   * @return RegionDiskTypeList
97   */
98  public function listRegionDiskTypes($project, $region, $optParams = [])
99  {
100    $params = ['project' => $project, 'region' => $region];
101    $params = array_merge($params, $optParams);
102    return $this->call('list', [$params], RegionDiskTypeList::class);
103  }
104}
105
106// Adding a class alias for backwards compatibility with the previous class name.
107class_alias(RegionDiskTypes::class, 'Google_Service_Compute_Resource_RegionDiskTypes');
108