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\DataprocMetastore\Resource;
19
20use Google\Service\DataprocMetastore\ListMetadataImportsResponse;
21use Google\Service\DataprocMetastore\MetadataImport;
22use Google\Service\DataprocMetastore\Operation;
23
24/**
25 * The "metadataImports" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $metastoreService = new Google\Service\DataprocMetastore(...);
29 *   $metadataImports = $metastoreService->metadataImports;
30 *  </code>
31 */
32class ProjectsLocationsServicesMetadataImports extends \Google\Service\Resource
33{
34  /**
35   * Creates a new MetadataImport in a given project and location.
36   * (metadataImports.create)
37   *
38   * @param string $parent Required. The relative resource name of the service in
39   * which to create a metastore import, in the following
40   * form:projects/{project_number}/locations/{location_id}/services/{service_id}.
41   * @param MetadataImport $postBody
42   * @param array $optParams Optional parameters.
43   *
44   * @opt_param string metadataImportId Required. The ID of the metadata import,
45   * which is used as the final component of the metadata import's name.This value
46   * must be between 1 and 64 characters long, begin with a letter, end with a
47   * letter or number, and consist of alpha-numeric ASCII characters or hyphens.
48   * @opt_param string requestId Optional. A request ID. Specify a unique request
49   * ID to allow the server to ignore the request if it has completed. The server
50   * will ignore subsequent requests that provide a duplicate request ID for at
51   * least 60 minutes after the first request.For example, if an initial request
52   * times out, followed by another request with the same request ID, the server
53   * ignores the second request to prevent the creation of duplicate
54   * commitments.The request ID must be a valid UUID
55   * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero
56   * UUID (00000000-0000-0000-0000-000000000000) is not supported.
57   * @return Operation
58   */
59  public function create($parent, MetadataImport $postBody, $optParams = [])
60  {
61    $params = ['parent' => $parent, 'postBody' => $postBody];
62    $params = array_merge($params, $optParams);
63    return $this->call('create', [$params], Operation::class);
64  }
65  /**
66   * Gets details of a single import. (metadataImports.get)
67   *
68   * @param string $name Required. The relative resource name of the metadata
69   * import to retrieve, in the following form:projects/{project_number}/locations
70   * /{location_id}/services/{service_id}/metadataImports/{import_id}.
71   * @param array $optParams Optional parameters.
72   * @return MetadataImport
73   */
74  public function get($name, $optParams = [])
75  {
76    $params = ['name' => $name];
77    $params = array_merge($params, $optParams);
78    return $this->call('get', [$params], MetadataImport::class);
79  }
80  /**
81   * Lists imports in a service.
82   * (metadataImports.listProjectsLocationsServicesMetadataImports)
83   *
84   * @param string $parent Required. The relative resource name of the service
85   * whose metadata imports to list, in the following form:projects/{project_numbe
86   * r}/locations/{location_id}/services/{service_id}/metadataImports.
87   * @param array $optParams Optional parameters.
88   *
89   * @opt_param string filter Optional. The filter to apply to list results.
90   * @opt_param string orderBy Optional. Specify the ordering of results as
91   * described in Sorting Order
92   * (https://cloud.google.com/apis/design/design_patterns#sorting_order). If not
93   * specified, the results will be sorted in the default order.
94   * @opt_param int pageSize Optional. The maximum number of imports to return.
95   * The response may contain less than the maximum number. If unspecified, no
96   * more than 500 imports are returned. The maximum value is 1000; values above
97   * 1000 are changed to 1000.
98   * @opt_param string pageToken Optional. A page token, received from a previous
99   * DataprocMetastore.ListServices call. Provide this token to retrieve the
100   * subsequent page.To retrieve the first page, supply an empty page token.When
101   * paginating, other parameters provided to DataprocMetastore.ListServices must
102   * match the call that provided the page token.
103   * @return ListMetadataImportsResponse
104   */
105  public function listProjectsLocationsServicesMetadataImports($parent, $optParams = [])
106  {
107    $params = ['parent' => $parent];
108    $params = array_merge($params, $optParams);
109    return $this->call('list', [$params], ListMetadataImportsResponse::class);
110  }
111  /**
112   * Updates a single import. Only the description field of MetadataImport is
113   * supported to be updated. (metadataImports.patch)
114   *
115   * @param string $name Immutable. The relative resource name of the metadata
116   * import, of the form:projects/{project_number}/locations/{location_id}/service
117   * s/{service_id}/metadataImports/{metadata_import_id}.
118   * @param MetadataImport $postBody
119   * @param array $optParams Optional parameters.
120   *
121   * @opt_param string requestId Optional. A request ID. Specify a unique request
122   * ID to allow the server to ignore the request if it has completed. The server
123   * will ignore subsequent requests that provide a duplicate request ID for at
124   * least 60 minutes after the first request.For example, if an initial request
125   * times out, followed by another request with the same request ID, the server
126   * ignores the second request to prevent the creation of duplicate
127   * commitments.The request ID must be a valid UUID
128   * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero
129   * UUID (00000000-0000-0000-0000-000000000000) is not supported.
130   * @opt_param string updateMask Required. A field mask used to specify the
131   * fields to be overwritten in the metadata import resource by the update.
132   * Fields specified in the update_mask are relative to the resource (not to the
133   * full request). A field is overwritten if it is in the mask.
134   * @return Operation
135   */
136  public function patch($name, MetadataImport $postBody, $optParams = [])
137  {
138    $params = ['name' => $name, 'postBody' => $postBody];
139    $params = array_merge($params, $optParams);
140    return $this->call('patch', [$params], Operation::class);
141  }
142}
143
144// Adding a class alias for backwards compatibility with the previous class name.
145class_alias(ProjectsLocationsServicesMetadataImports::class, 'Google_Service_DataprocMetastore_Resource_ProjectsLocationsServicesMetadataImports');
146