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 | namespace Google\Service\DatabaseMigrationService\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DatabaseMigrationService\DatamigrationEmpty;
|
---|
21 | use Google\Service\DatabaseMigrationService\ImportMappingRulesRequest;
|
---|
22 | use Google\Service\DatabaseMigrationService\ListMappingRulesResponse;
|
---|
23 | use Google\Service\DatabaseMigrationService\MappingRule;
|
---|
24 | use Google\Service\DatabaseMigrationService\Operation;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "mappingRules" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $datamigrationService = new Google\Service\DatabaseMigrationService(...);
|
---|
31 | * $mappingRules = $datamigrationService->projects_locations_conversionWorkspaces_mappingRules;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class ProjectsLocationsConversionWorkspacesMappingRules extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Creates a new mapping rule for a given conversion workspace.
|
---|
38 | * (mappingRules.create)
|
---|
39 | *
|
---|
40 | * @param string $parent Required. The parent which owns this collection of
|
---|
41 | * mapping rules.
|
---|
42 | * @param MappingRule $postBody
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | *
|
---|
45 | * @opt_param string mappingRuleId Required. The ID of the rule to create.
|
---|
46 | * @opt_param string requestId A unique ID used to identify the request. If the
|
---|
47 | * server receives two requests with the same ID, then the second request is
|
---|
48 | * ignored. It is recommended to always set this value to a UUID. The ID must
|
---|
49 | * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens
|
---|
50 | * (-). The maximum length is 40 characters.
|
---|
51 | * @return MappingRule
|
---|
52 | * @throws \Google\Service\Exception
|
---|
53 | */
|
---|
54 | public function create($parent, MappingRule $postBody, $optParams = [])
|
---|
55 | {
|
---|
56 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
57 | $params = array_merge($params, $optParams);
|
---|
58 | return $this->call('create', [$params], MappingRule::class);
|
---|
59 | }
|
---|
60 | /**
|
---|
61 | * Deletes a single mapping rule. (mappingRules.delete)
|
---|
62 | *
|
---|
63 | * @param string $name Required. Name of the mapping rule resource to delete.
|
---|
64 | * @param array $optParams Optional parameters.
|
---|
65 | *
|
---|
66 | * @opt_param string requestId Optional. A unique ID used to identify the
|
---|
67 | * request. If the server receives two requests with the same ID, then the
|
---|
68 | * second request is ignored. It is recommended to always set this value to a
|
---|
69 | * UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
|
---|
70 | * (_), and hyphens (-). The maximum length is 40 characters.
|
---|
71 | * @return DatamigrationEmpty
|
---|
72 | * @throws \Google\Service\Exception
|
---|
73 | */
|
---|
74 | public function delete($name, $optParams = [])
|
---|
75 | {
|
---|
76 | $params = ['name' => $name];
|
---|
77 | $params = array_merge($params, $optParams);
|
---|
78 | return $this->call('delete', [$params], DatamigrationEmpty::class);
|
---|
79 | }
|
---|
80 | /**
|
---|
81 | * Gets the details of a mapping rule. (mappingRules.get)
|
---|
82 | *
|
---|
83 | * @param string $name Required. Name of the mapping rule resource to get.
|
---|
84 | * Example: conversionWorkspaces/123/mappingRules/rule123 In order to retrieve a
|
---|
85 | * previous revision of the mapping rule, also provide the revision ID. Example:
|
---|
86 | * conversionWorkspace/123/mappingRules/rule123@c7cfa2a8c7cfa2a8c7cfa2a8c7cfa2a8
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | * @return MappingRule
|
---|
89 | * @throws \Google\Service\Exception
|
---|
90 | */
|
---|
91 | public function get($name, $optParams = [])
|
---|
92 | {
|
---|
93 | $params = ['name' => $name];
|
---|
94 | $params = array_merge($params, $optParams);
|
---|
95 | return $this->call('get', [$params], MappingRule::class);
|
---|
96 | }
|
---|
97 | /**
|
---|
98 | * Imports the mapping rules for a given conversion workspace. Supports various
|
---|
99 | * formats of external rules files. (mappingRules.import)
|
---|
100 | *
|
---|
101 | * @param string $parent Required. Name of the conversion workspace resource to
|
---|
102 | * import the rules to in the form of: projects/{project}/locations/{location}/c
|
---|
103 | * onversionWorkspaces/{conversion_workspace}.
|
---|
104 | * @param ImportMappingRulesRequest $postBody
|
---|
105 | * @param array $optParams Optional parameters.
|
---|
106 | * @return Operation
|
---|
107 | * @throws \Google\Service\Exception
|
---|
108 | */
|
---|
109 | public function import($parent, ImportMappingRulesRequest $postBody, $optParams = [])
|
---|
110 | {
|
---|
111 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
112 | $params = array_merge($params, $optParams);
|
---|
113 | return $this->call('import', [$params], Operation::class);
|
---|
114 | }
|
---|
115 | /**
|
---|
116 | * Lists the mapping rules for a specific conversion workspace.
|
---|
117 | * (mappingRules.listProjectsLocationsConversionWorkspacesMappingRules)
|
---|
118 | *
|
---|
119 | * @param string $parent Required. Name of the conversion workspace resource
|
---|
120 | * whose mapping rules are listed in the form of: projects/{project}/locations/{
|
---|
121 | * location}/conversionWorkspaces/{conversion_workspace}.
|
---|
122 | * @param array $optParams Optional parameters.
|
---|
123 | *
|
---|
124 | * @opt_param int pageSize The maximum number of rules to return. The service
|
---|
125 | * may return fewer than this value.
|
---|
126 | * @opt_param string pageToken The nextPageToken value received in the previous
|
---|
127 | * call to mappingRules.list, used in the subsequent request to retrieve the
|
---|
128 | * next page of results. On first call this should be left blank. When
|
---|
129 | * paginating, all other parameters provided to mappingRules.list must match the
|
---|
130 | * call that provided the page token.
|
---|
131 | * @return ListMappingRulesResponse
|
---|
132 | * @throws \Google\Service\Exception
|
---|
133 | */
|
---|
134 | public function listProjectsLocationsConversionWorkspacesMappingRules($parent, $optParams = [])
|
---|
135 | {
|
---|
136 | $params = ['parent' => $parent];
|
---|
137 | $params = array_merge($params, $optParams);
|
---|
138 | return $this->call('list', [$params], ListMappingRulesResponse::class);
|
---|
139 | }
|
---|
140 | }
|
---|
141 |
|
---|
142 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
143 | class_alias(ProjectsLocationsConversionWorkspacesMappingRules::class, 'Google_Service_DatabaseMigrationService_Resource_ProjectsLocationsConversionWorkspacesMappingRules');
|
---|