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\BigQueryDataTransfer\Resource;
19
20use Google\Service\BigQueryDataTransfer\BigquerydatatransferEmpty;
21use Google\Service\BigQueryDataTransfer\EnrollDataSourcesRequest;
22use Google\Service\BigQueryDataTransfer\ListLocationsResponse;
23use Google\Service\BigQueryDataTransfer\Location;
24
25/**
26 * The "locations" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $bigquerydatatransferService = new Google\Service\BigQueryDataTransfer(...);
30 *   $locations = $bigquerydatatransferService->locations;
31 *  </code>
32 */
33class ProjectsLocations extends \Google\Service\Resource
34{
35  /**
36   * Enroll data sources in a user project. This allows users to create transfer
37   * configurations for these data sources. They will also appear in the
38   * ListDataSources RPC and as such, will appear in the [BigQuery
39   * UI](https://console.cloud.google.com/bigquery), and the documents can be
40   * found in the public guide for [BigQuery Web
41   * UI](https://cloud.google.com/bigquery/bigquery-web-ui) and [Data Transfer
42   * Service](https://cloud.google.com/bigquery/docs/working-with-transfers).
43   * (locations.enrollDataSources)
44   *
45   * @param string $name The name of the project resource in the form:
46   * `projects/{project_id}`
47   * @param EnrollDataSourcesRequest $postBody
48   * @param array $optParams Optional parameters.
49   * @return BigquerydatatransferEmpty
50   */
51  public function enrollDataSources($name, EnrollDataSourcesRequest $postBody, $optParams = [])
52  {
53    $params = ['name' => $name, 'postBody' => $postBody];
54    $params = array_merge($params, $optParams);
55    return $this->call('enrollDataSources', [$params], BigquerydatatransferEmpty::class);
56  }
57  /**
58   * Gets information about a location. (locations.get)
59   *
60   * @param string $name Resource name for the location.
61   * @param array $optParams Optional parameters.
62   * @return Location
63   */
64  public function get($name, $optParams = [])
65  {
66    $params = ['name' => $name];
67    $params = array_merge($params, $optParams);
68    return $this->call('get', [$params], Location::class);
69  }
70  /**
71   * Lists information about the supported locations for this service.
72   * (locations.listProjectsLocations)
73   *
74   * @param string $name The resource that owns the locations collection, if
75   * applicable.
76   * @param array $optParams Optional parameters.
77   *
78   * @opt_param string filter A filter to narrow down results to a preferred
79   * subset. The filtering language accepts strings like `"displayName=tokyo"`,
80   * and is documented in more detail in [AIP-160](https://google.aip.dev/160).
81   * @opt_param int pageSize The maximum number of results to return. If not set,
82   * the service selects a default.
83   * @opt_param string pageToken A page token received from the `next_page_token`
84   * field in the response. Send that page token to receive the subsequent page.
85   * @return ListLocationsResponse
86   */
87  public function listProjectsLocations($name, $optParams = [])
88  {
89    $params = ['name' => $name];
90    $params = array_merge($params, $optParams);
91    return $this->call('list', [$params], ListLocationsResponse::class);
92  }
93}
94
95// Adding a class alias for backwards compatibility with the previous class name.
96class_alias(ProjectsLocations::class, 'Google_Service_BigQueryDataTransfer_Resource_ProjectsLocations');
97