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
18/**
19 * The "regions" collection of methods.
20 * Typical usage is:
21 *  <code>
22 *   $computeService = new Google_Service_Compute(...);
23 *   $regions = $computeService->regions;
24 *  </code>
25 */
26class Google_Service_Compute_Resource_Regions extends Google_Service_Resource
27{
28  /**
29   * Returns the specified Region resource. Gets a list of available regions by
30   * making a list() request. (regions.get)
31   *
32   * @param string $project Project ID for this request.
33   * @param string $region Name of the region resource to return.
34   * @param array $optParams Optional parameters.
35   * @return Google_Service_Compute_Region
36   */
37  public function get($project, $region, $optParams = array())
38  {
39    $params = array('project' => $project, 'region' => $region);
40    $params = array_merge($params, $optParams);
41    return $this->call('get', array($params), "Google_Service_Compute_Region");
42  }
43  /**
44   * Retrieves the list of region resources available to the specified project.
45   * (regions.listRegions)
46   *
47   * @param string $project Project ID for this request.
48   * @param array $optParams Optional parameters.
49   *
50   * @opt_param string filter A filter expression that filters resources listed in
51   * the response. The expression must specify the field name, a comparison
52   * operator, and the value that you want to use for filtering. The value must be
53   * a string, a number, or a boolean. The comparison operator must be either =,
54   * !=, >, or <.
55   *
56   * For example, if you are filtering Compute Engine instances, you can exclude
57   * instances named example-instance by specifying name != example-instance.
58   *
59   * You can also filter nested fields. For example, you could specify
60   * scheduling.automaticRestart = false to include instances only if they are not
61   * scheduled for automatic restarts. You can use filtering on nested fields to
62   * filter based on resource labels.
63   *
64   * To filter on multiple expressions, provide each separate expression within
65   * parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform =
66   * "Intel Skylake"). By default, each expression is an AND expression. However,
67   * you can include AND and OR expressions explicitly. For example, (cpuPlatform
68   * = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
69   * (scheduling.automaticRestart = true).
70   * @opt_param string maxResults The maximum number of results per page that
71   * should be returned. If the number of available results is larger than
72   * maxResults, Compute Engine returns a nextPageToken that can be used to get
73   * the next page of results in subsequent list requests. Acceptable values are 0
74   * to 500, inclusive. (Default: 500)
75   * @opt_param string orderBy Sorts list results by a certain order. By default,
76   * results are returned in alphanumerical order based on the resource name.
77   *
78   * You can also sort results in descending order based on the creation timestamp
79   * using orderBy="creationTimestamp desc". This sorts results based on the
80   * creationTimestamp field in reverse chronological order (newest result first).
81   * Use this to sort resources like operations so that the newest operation is
82   * returned first.
83   *
84   * Currently, only sorting by name or creationTimestamp desc is supported.
85   * @opt_param string pageToken Specifies a page token to use. Set pageToken to
86   * the nextPageToken returned by a previous list request to get the next page of
87   * results.
88   * @return Google_Service_Compute_RegionList
89   */
90  public function listRegions($project, $optParams = array())
91  {
92    $params = array('project' => $project);
93    $params = array_merge($params, $optParams);
94    return $this->call('list', array($params), "Google_Service_Compute_RegionList");
95  }
96}
97