[e3d4e0a] | 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\DLP\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\DLP\GooglePrivacyDlpV2CreateJobTriggerRequest;
|
---|
| 21 | use Google\Service\DLP\GooglePrivacyDlpV2JobTrigger;
|
---|
| 22 | use Google\Service\DLP\GooglePrivacyDlpV2ListJobTriggersResponse;
|
---|
| 23 | use Google\Service\DLP\GooglePrivacyDlpV2UpdateJobTriggerRequest;
|
---|
| 24 | use Google\Service\DLP\GoogleProtobufEmpty;
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * The "jobTriggers" collection of methods.
|
---|
| 28 | * Typical usage is:
|
---|
| 29 | * <code>
|
---|
| 30 | * $dlpService = new Google\Service\DLP(...);
|
---|
| 31 | * $jobTriggers = $dlpService->organizations_locations_jobTriggers;
|
---|
| 32 | * </code>
|
---|
| 33 | */
|
---|
| 34 | class OrganizationsLocationsJobTriggers extends \Google\Service\Resource
|
---|
| 35 | {
|
---|
| 36 | /**
|
---|
| 37 | * Creates a job trigger to run DLP actions such as scanning storage for
|
---|
| 38 | * sensitive information on a set schedule. See
|
---|
| 39 | * https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers
|
---|
| 40 | * to learn more. (jobTriggers.create)
|
---|
| 41 | *
|
---|
| 42 | * @param string $parent Required. Parent resource name. The format of this
|
---|
| 43 | * value varies depending on whether you have [specified a processing
|
---|
| 44 | * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-
|
---|
| 45 | * location): + Projects scope, location specified:
|
---|
| 46 | * `projects/{project_id}/locations/{location_id}` + Projects scope, no location
|
---|
| 47 | * specified (defaults to global): `projects/{project_id}` The following example
|
---|
| 48 | * `parent` string specifies a parent project with the identifier `example-
|
---|
| 49 | * project`, and specifies the `europe-west3` location for processing data:
|
---|
| 50 | * parent=projects/example-project/locations/europe-west3
|
---|
| 51 | * @param GooglePrivacyDlpV2CreateJobTriggerRequest $postBody
|
---|
| 52 | * @param array $optParams Optional parameters.
|
---|
| 53 | * @return GooglePrivacyDlpV2JobTrigger
|
---|
| 54 | * @throws \Google\Service\Exception
|
---|
| 55 | */
|
---|
| 56 | public function create($parent, GooglePrivacyDlpV2CreateJobTriggerRequest $postBody, $optParams = [])
|
---|
| 57 | {
|
---|
| 58 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 59 | $params = array_merge($params, $optParams);
|
---|
| 60 | return $this->call('create', [$params], GooglePrivacyDlpV2JobTrigger::class);
|
---|
| 61 | }
|
---|
| 62 | /**
|
---|
| 63 | * Deletes a job trigger. See https://cloud.google.com/sensitive-data-
|
---|
| 64 | * protection/docs/creating-job-triggers to learn more. (jobTriggers.delete)
|
---|
| 65 | *
|
---|
| 66 | * @param string $name Required. Resource name of the project and the
|
---|
| 67 | * triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`.
|
---|
| 68 | * @param array $optParams Optional parameters.
|
---|
| 69 | * @return GoogleProtobufEmpty
|
---|
| 70 | * @throws \Google\Service\Exception
|
---|
| 71 | */
|
---|
| 72 | public function delete($name, $optParams = [])
|
---|
| 73 | {
|
---|
| 74 | $params = ['name' => $name];
|
---|
| 75 | $params = array_merge($params, $optParams);
|
---|
| 76 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
| 77 | }
|
---|
| 78 | /**
|
---|
| 79 | * Gets a job trigger. See https://cloud.google.com/sensitive-data-
|
---|
| 80 | * protection/docs/creating-job-triggers to learn more. (jobTriggers.get)
|
---|
| 81 | *
|
---|
| 82 | * @param string $name Required. Resource name of the project and the
|
---|
| 83 | * triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`.
|
---|
| 84 | * @param array $optParams Optional parameters.
|
---|
| 85 | * @return GooglePrivacyDlpV2JobTrigger
|
---|
| 86 | * @throws \Google\Service\Exception
|
---|
| 87 | */
|
---|
| 88 | public function get($name, $optParams = [])
|
---|
| 89 | {
|
---|
| 90 | $params = ['name' => $name];
|
---|
| 91 | $params = array_merge($params, $optParams);
|
---|
| 92 | return $this->call('get', [$params], GooglePrivacyDlpV2JobTrigger::class);
|
---|
| 93 | }
|
---|
| 94 | /**
|
---|
| 95 | * Lists job triggers. See https://cloud.google.com/sensitive-data-
|
---|
| 96 | * protection/docs/creating-job-triggers to learn more.
|
---|
| 97 | * (jobTriggers.listOrganizationsLocationsJobTriggers)
|
---|
| 98 | *
|
---|
| 99 | * @param string $parent Required. Parent resource name. The format of this
|
---|
| 100 | * value varies depending on whether you have [specified a processing
|
---|
| 101 | * location](https://cloud.google.com/sensitive-data-protection/docs/specifying-
|
---|
| 102 | * location): + Projects scope, location specified:
|
---|
| 103 | * `projects/{project_id}/locations/{location_id}` + Projects scope, no location
|
---|
| 104 | * specified (defaults to global): `projects/{project_id}` The following example
|
---|
| 105 | * `parent` string specifies a parent project with the identifier `example-
|
---|
| 106 | * project`, and specifies the `europe-west3` location for processing data:
|
---|
| 107 | * parent=projects/example-project/locations/europe-west3
|
---|
| 108 | * @param array $optParams Optional parameters.
|
---|
| 109 | *
|
---|
| 110 | * @opt_param string filter Allows filtering. Supported syntax: * Filter
|
---|
| 111 | * expressions are made up of one or more restrictions. * Restrictions can be
|
---|
| 112 | * combined by `AND` or `OR` logical operators. A sequence of restrictions
|
---|
| 113 | * implicitly uses `AND`. * A restriction has the form of `{field} {operator}
|
---|
| 114 | * {value}`. * Supported fields/values for inspect triggers: - `status` -
|
---|
| 115 | * HEALTHY|PAUSED|CANCELLED - `inspected_storage` -
|
---|
| 116 | * DATASTORE|CLOUD_STORAGE|BIGQUERY - 'last_run_time` - RFC 3339 formatted
|
---|
| 117 | * timestamp, surrounded by quotation marks. Nanoseconds are ignored. -
|
---|
| 118 | * 'error_count' - Number of errors that have occurred while running. * The
|
---|
| 119 | * operator must be `=` or `!=` for status and inspected_storage. Examples: *
|
---|
| 120 | * inspected_storage = cloud_storage AND status = HEALTHY * inspected_storage =
|
---|
| 121 | * cloud_storage OR inspected_storage = bigquery * inspected_storage =
|
---|
| 122 | * cloud_storage AND (state = PAUSED OR state = HEALTHY) * last_run_time >
|
---|
| 123 | * \"2017-12-12T00:00:00+00:00\" The length of this field should be no more than
|
---|
| 124 | * 500 characters.
|
---|
| 125 | * @opt_param string locationId Deprecated. This field has no effect.
|
---|
| 126 | * @opt_param string orderBy Comma-separated list of triggeredJob fields to
|
---|
| 127 | * order by, followed by `asc` or `desc` postfix. This list is case insensitive.
|
---|
| 128 | * The default sorting order is ascending. Redundant space characters are
|
---|
| 129 | * insignificant. Example: `name asc,update_time, create_time desc` Supported
|
---|
| 130 | * fields are: - `create_time`: corresponds to the time the JobTrigger was
|
---|
| 131 | * created. - `update_time`: corresponds to the time the JobTrigger was last
|
---|
| 132 | * updated. - `last_run_time`: corresponds to the last time the JobTrigger ran.
|
---|
| 133 | * - `name`: corresponds to the JobTrigger's name. - `display_name`: corresponds
|
---|
| 134 | * to the JobTrigger's display name. - `status`: corresponds to JobTrigger's
|
---|
| 135 | * status.
|
---|
| 136 | * @opt_param int pageSize Size of the page. This value can be limited by a
|
---|
| 137 | * server.
|
---|
| 138 | * @opt_param string pageToken Page token to continue retrieval. Comes from the
|
---|
| 139 | * previous call to ListJobTriggers. `order_by` field must not change for
|
---|
| 140 | * subsequent calls.
|
---|
| 141 | * @opt_param string type The type of jobs. Will use `DlpJobType.INSPECT` if not
|
---|
| 142 | * set.
|
---|
| 143 | * @return GooglePrivacyDlpV2ListJobTriggersResponse
|
---|
| 144 | * @throws \Google\Service\Exception
|
---|
| 145 | */
|
---|
| 146 | public function listOrganizationsLocationsJobTriggers($parent, $optParams = [])
|
---|
| 147 | {
|
---|
| 148 | $params = ['parent' => $parent];
|
---|
| 149 | $params = array_merge($params, $optParams);
|
---|
| 150 | return $this->call('list', [$params], GooglePrivacyDlpV2ListJobTriggersResponse::class);
|
---|
| 151 | }
|
---|
| 152 | /**
|
---|
| 153 | * Updates a job trigger. See https://cloud.google.com/sensitive-data-
|
---|
| 154 | * protection/docs/creating-job-triggers to learn more. (jobTriggers.patch)
|
---|
| 155 | *
|
---|
| 156 | * @param string $name Required. Resource name of the project and the
|
---|
| 157 | * triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`.
|
---|
| 158 | * @param GooglePrivacyDlpV2UpdateJobTriggerRequest $postBody
|
---|
| 159 | * @param array $optParams Optional parameters.
|
---|
| 160 | * @return GooglePrivacyDlpV2JobTrigger
|
---|
| 161 | * @throws \Google\Service\Exception
|
---|
| 162 | */
|
---|
| 163 | public function patch($name, GooglePrivacyDlpV2UpdateJobTriggerRequest $postBody, $optParams = [])
|
---|
| 164 | {
|
---|
| 165 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 166 | $params = array_merge($params, $optParams);
|
---|
| 167 | return $this->call('patch', [$params], GooglePrivacyDlpV2JobTrigger::class);
|
---|
| 168 | }
|
---|
| 169 | }
|
---|
| 170 |
|
---|
| 171 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 172 | class_alias(OrganizationsLocationsJobTriggers::class, 'Google_Service_DLP_Resource_OrganizationsLocationsJobTriggers');
|
---|