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\DiskTypeAggregatedList;
22use Google\Service\Compute\DiskTypeList;
23
24/**
25 * The "diskTypes" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $computeService = new Google\Service\Compute(...);
29 *   $diskTypes = $computeService->diskTypes;
30 *  </code>
31 */
32class DiskTypes extends \Google\Service\Resource
33{
34  /**
35   * Retrieves an aggregated list of disk types. (diskTypes.aggregatedList)
36   *
37   * @param string $project Project ID for this request.
38   * @param array $optParams Optional parameters.
39   *
40   * @opt_param string filter A filter expression that filters resources listed in
41   * the response. The expression must specify the field name, an operator, and
42   * the value that you want to use for filtering. The value must be a string, a
43   * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
44   * `>=` or `:`. For example, if you are filtering Compute Engine instances, you
45   * can exclude instances named `example-instance` by specifying `name !=
46   * example-instance`. The `:` operator can be used with string fields to match
47   * substrings. For non-string fields it is equivalent to the `=` operator. The
48   * `:*` comparison can be used to test whether a key has been defined. For
49   * example, to find all objects with `owner` label use: ``` labels.owner:* ```
50   * You can also filter nested fields. For example, you could specify
51   * `scheduling.automaticRestart = false` to include instances only if they are
52   * not scheduled for automatic restarts. You can use filtering on nested fields
53   * to filter based on resource labels. To filter on multiple expressions,
54   * provide each separate expression within parentheses. For example: ```
55   * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
56   * default, each expression is an `AND` expression. However, you can include
57   * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
58   * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
59   * (scheduling.automaticRestart = true) ```
60   * @opt_param bool includeAllScopes Indicates whether every visible scope for
61   * each scope type (zone, region, global) should be included in the response.
62   * For new resource types added after this field, the flag has no effect as new
63   * resource types will always include every visible scope for each scope type in
64   * response. For resource types which predate this field, if this flag is
65   * omitted or false, only scopes of the scope types where the resource type is
66   * expected to be found will be included.
67   * @opt_param string maxResults The maximum number of results per page that
68   * should be returned. If the number of available results is larger than
69   * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
70   * get the next page of results in subsequent list requests. Acceptable values
71   * are `0` to `500`, inclusive. (Default: `500`)
72   * @opt_param string orderBy Sorts list results by a certain order. By default,
73   * results are returned in alphanumerical order based on the resource name. You
74   * can also sort results in descending order based on the creation timestamp
75   * using `orderBy="creationTimestamp desc"`. This sorts results based on the
76   * `creationTimestamp` field in reverse chronological order (newest result
77   * first). Use this to sort resources like operations so that the newest
78   * operation is returned first. Currently, only sorting by `name` or
79   * `creationTimestamp desc` is supported.
80   * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
81   * the `nextPageToken` returned by a previous list request to get the next page
82   * of results.
83   * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
84   * which provides partial results in case of failure. The default value is
85   * false.
86   * @return DiskTypeAggregatedList
87   */
88  public function aggregatedList($project, $optParams = [])
89  {
90    $params = ['project' => $project];
91    $params = array_merge($params, $optParams);
92    return $this->call('aggregatedList', [$params], DiskTypeAggregatedList::class);
93  }
94  /**
95   * Returns the specified disk type. Gets a list of available disk types by
96   * making a list() request. (diskTypes.get)
97   *
98   * @param string $project Project ID for this request.
99   * @param string $zone The name of the zone for this request.
100   * @param string $diskType Name of the disk type to return.
101   * @param array $optParams Optional parameters.
102   * @return DiskType
103   */
104  public function get($project, $zone, $diskType, $optParams = [])
105  {
106    $params = ['project' => $project, 'zone' => $zone, 'diskType' => $diskType];
107    $params = array_merge($params, $optParams);
108    return $this->call('get', [$params], DiskType::class);
109  }
110  /**
111   * Retrieves a list of disk types available to the specified project.
112   * (diskTypes.listDiskTypes)
113   *
114   * @param string $project Project ID for this request.
115   * @param string $zone The name of the zone for this request.
116   * @param array $optParams Optional parameters.
117   *
118   * @opt_param string filter A filter expression that filters resources listed in
119   * the response. The expression must specify the field name, an operator, and
120   * the value that you want to use for filtering. The value must be a string, a
121   * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`,
122   * `>=` or `:`. For example, if you are filtering Compute Engine instances, you
123   * can exclude instances named `example-instance` by specifying `name !=
124   * example-instance`. The `:` operator can be used with string fields to match
125   * substrings. For non-string fields it is equivalent to the `=` operator. The
126   * `:*` comparison can be used to test whether a key has been defined. For
127   * example, to find all objects with `owner` label use: ``` labels.owner:* ```
128   * You can also filter nested fields. For example, you could specify
129   * `scheduling.automaticRestart = false` to include instances only if they are
130   * not scheduled for automatic restarts. You can use filtering on nested fields
131   * to filter based on resource labels. To filter on multiple expressions,
132   * provide each separate expression within parentheses. For example: ```
133   * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
134   * default, each expression is an `AND` expression. However, you can include
135   * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
136   * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
137   * (scheduling.automaticRestart = true) ```
138   * @opt_param string maxResults The maximum number of results per page that
139   * should be returned. If the number of available results is larger than
140   * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
141   * get the next page of results in subsequent list requests. Acceptable values
142   * are `0` to `500`, inclusive. (Default: `500`)
143   * @opt_param string orderBy Sorts list results by a certain order. By default,
144   * results are returned in alphanumerical order based on the resource name. You
145   * can also sort results in descending order based on the creation timestamp
146   * using `orderBy="creationTimestamp desc"`. This sorts results based on the
147   * `creationTimestamp` field in reverse chronological order (newest result
148   * first). Use this to sort resources like operations so that the newest
149   * operation is returned first. Currently, only sorting by `name` or
150   * `creationTimestamp desc` is supported.
151   * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
152   * the `nextPageToken` returned by a previous list request to get the next page
153   * of results.
154   * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
155   * which provides partial results in case of failure. The default value is
156   * false.
157   * @return DiskTypeList
158   */
159  public function listDiskTypes($project, $zone, $optParams = [])
160  {
161    $params = ['project' => $project, 'zone' => $zone];
162    $params = array_merge($params, $optParams);
163    return $this->call('list', [$params], DiskTypeList::class);
164  }
165}
166
167// Adding a class alias for backwards compatibility with the previous class name.
168class_alias(DiskTypes::class, 'Google_Service_Compute_Resource_DiskTypes');
169