[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\DeveloperConnect\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\DeveloperConnect\DeveloperconnectEmpty;
|
---|
| 21 | use Google\Service\DeveloperConnect\FetchGitRefsResponse;
|
---|
| 22 | use Google\Service\DeveloperConnect\FetchReadTokenRequest;
|
---|
| 23 | use Google\Service\DeveloperConnect\FetchReadTokenResponse;
|
---|
| 24 | use Google\Service\DeveloperConnect\FetchReadWriteTokenRequest;
|
---|
| 25 | use Google\Service\DeveloperConnect\FetchReadWriteTokenResponse;
|
---|
| 26 | use Google\Service\DeveloperConnect\GitRepositoryLink;
|
---|
| 27 | use Google\Service\DeveloperConnect\ListGitRepositoryLinksResponse;
|
---|
| 28 | use Google\Service\DeveloperConnect\Operation;
|
---|
| 29 | use Google\Service\DeveloperConnect\ProcessGitLabEnterpriseWebhookRequest;
|
---|
| 30 | use Google\Service\DeveloperConnect\ProcessGitLabWebhookRequest;
|
---|
| 31 |
|
---|
| 32 | /**
|
---|
| 33 | * The "gitRepositoryLinks" collection of methods.
|
---|
| 34 | * Typical usage is:
|
---|
| 35 | * <code>
|
---|
| 36 | * $developerconnectService = new Google\Service\DeveloperConnect(...);
|
---|
| 37 | * $gitRepositoryLinks = $developerconnectService->projects_locations_connections_gitRepositoryLinks;
|
---|
| 38 | * </code>
|
---|
| 39 | */
|
---|
| 40 | class ProjectsLocationsConnectionsGitRepositoryLinks extends \Google\Service\Resource
|
---|
| 41 | {
|
---|
| 42 | /**
|
---|
| 43 | * Creates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect
|
---|
| 44 | * will configure the Git Repository to send webhook events to Developer
|
---|
| 45 | * Connect. Connections that use Firebase GitHub Application will have events
|
---|
| 46 | * forwarded to the Firebase service. All other Connections will have events
|
---|
| 47 | * forwarded to Cloud Build. (gitRepositoryLinks.create)
|
---|
| 48 | *
|
---|
| 49 | * @param string $parent Required. Value for parent.
|
---|
| 50 | * @param GitRepositoryLink $postBody
|
---|
| 51 | * @param array $optParams Optional parameters.
|
---|
| 52 | *
|
---|
| 53 | * @opt_param string gitRepositoryLinkId Required. The ID to use for the
|
---|
| 54 | * repository, which will become the final component of the repository's
|
---|
| 55 | * resource name. This ID should be unique in the connection. Allows
|
---|
| 56 | * alphanumeric characters and any of -._~%!$&'()*+,;=@.
|
---|
| 57 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 58 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 59 | * the server will know to ignore the request if it has already been completed.
|
---|
| 60 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 61 | * request. For example, consider a situation where you make an initial request
|
---|
| 62 | * and the request times out. If you make the request again with the same
|
---|
| 63 | * request ID, the server can check if original operation with the same request
|
---|
| 64 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 65 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 66 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 67 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 68 | * @opt_param bool validateOnly Optional. If set, validate the request, but do
|
---|
| 69 | * not actually post it.
|
---|
| 70 | * @return Operation
|
---|
| 71 | * @throws \Google\Service\Exception
|
---|
| 72 | */
|
---|
| 73 | public function create($parent, GitRepositoryLink $postBody, $optParams = [])
|
---|
| 74 | {
|
---|
| 75 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 76 | $params = array_merge($params, $optParams);
|
---|
| 77 | return $this->call('create', [$params], Operation::class);
|
---|
| 78 | }
|
---|
| 79 | /**
|
---|
| 80 | * Deletes a single GitRepositoryLink. (gitRepositoryLinks.delete)
|
---|
| 81 | *
|
---|
| 82 | * @param string $name Required. Name of the resource
|
---|
| 83 | * @param array $optParams Optional parameters.
|
---|
| 84 | *
|
---|
| 85 | * @opt_param string etag Optional. This checksum is computed by the server
|
---|
| 86 | * based on the value of other fields, and may be sent on update and delete
|
---|
| 87 | * requests to ensure the client has an up-to-date value before proceeding.
|
---|
| 88 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 89 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 90 | * the server will know to ignore the request if it has already been completed.
|
---|
| 91 | * The server will guarantee that for at least 60 minutes after the first
|
---|
| 92 | * request. For example, consider a situation where you make an initial request
|
---|
| 93 | * and the request times out. If you make the request again with the same
|
---|
| 94 | * request ID, the server can check if original operation with the same request
|
---|
| 95 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 96 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 97 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 98 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 99 | * @opt_param bool validateOnly Optional. If set, validate the request, but do
|
---|
| 100 | * not actually post it.
|
---|
| 101 | * @return Operation
|
---|
| 102 | * @throws \Google\Service\Exception
|
---|
| 103 | */
|
---|
| 104 | public function delete($name, $optParams = [])
|
---|
| 105 | {
|
---|
| 106 | $params = ['name' => $name];
|
---|
| 107 | $params = array_merge($params, $optParams);
|
---|
| 108 | return $this->call('delete', [$params], Operation::class);
|
---|
| 109 | }
|
---|
| 110 | /**
|
---|
| 111 | * Fetch the list of branches or tags for a given repository.
|
---|
| 112 | * (gitRepositoryLinks.fetchGitRefs)
|
---|
| 113 | *
|
---|
| 114 | * @param string $gitRepositoryLink Required. The resource name of
|
---|
| 115 | * GitRepositoryLink in the format
|
---|
| 116 | * `projects/locations/connections/gitRepositoryLinks`.
|
---|
| 117 | * @param array $optParams Optional parameters.
|
---|
| 118 | *
|
---|
| 119 | * @opt_param int pageSize Optional. Number of results to return in the list.
|
---|
| 120 | * Default to 20.
|
---|
| 121 | * @opt_param string pageToken Optional. Page start.
|
---|
| 122 | * @opt_param string refType Required. Type of refs to fetch.
|
---|
| 123 | * @return FetchGitRefsResponse
|
---|
| 124 | * @throws \Google\Service\Exception
|
---|
| 125 | */
|
---|
| 126 | public function fetchGitRefs($gitRepositoryLink, $optParams = [])
|
---|
| 127 | {
|
---|
| 128 | $params = ['gitRepositoryLink' => $gitRepositoryLink];
|
---|
| 129 | $params = array_merge($params, $optParams);
|
---|
| 130 | return $this->call('fetchGitRefs', [$params], FetchGitRefsResponse::class);
|
---|
| 131 | }
|
---|
| 132 | /**
|
---|
| 133 | * Fetches read token of a given gitRepositoryLink.
|
---|
| 134 | * (gitRepositoryLinks.fetchReadToken)
|
---|
| 135 | *
|
---|
| 136 | * @param string $gitRepositoryLink Required. The resource name of the
|
---|
| 137 | * gitRepositoryLink in the format
|
---|
| 138 | * `projects/locations/connections/gitRepositoryLinks`.
|
---|
| 139 | * @param FetchReadTokenRequest $postBody
|
---|
| 140 | * @param array $optParams Optional parameters.
|
---|
| 141 | * @return FetchReadTokenResponse
|
---|
| 142 | * @throws \Google\Service\Exception
|
---|
| 143 | */
|
---|
| 144 | public function fetchReadToken($gitRepositoryLink, FetchReadTokenRequest $postBody, $optParams = [])
|
---|
| 145 | {
|
---|
| 146 | $params = ['gitRepositoryLink' => $gitRepositoryLink, 'postBody' => $postBody];
|
---|
| 147 | $params = array_merge($params, $optParams);
|
---|
| 148 | return $this->call('fetchReadToken', [$params], FetchReadTokenResponse::class);
|
---|
| 149 | }
|
---|
| 150 | /**
|
---|
| 151 | * Fetches read/write token of a given gitRepositoryLink.
|
---|
| 152 | * (gitRepositoryLinks.fetchReadWriteToken)
|
---|
| 153 | *
|
---|
| 154 | * @param string $gitRepositoryLink Required. The resource name of the
|
---|
| 155 | * gitRepositoryLink in the format
|
---|
| 156 | * `projects/locations/connections/gitRepositoryLinks`.
|
---|
| 157 | * @param FetchReadWriteTokenRequest $postBody
|
---|
| 158 | * @param array $optParams Optional parameters.
|
---|
| 159 | * @return FetchReadWriteTokenResponse
|
---|
| 160 | * @throws \Google\Service\Exception
|
---|
| 161 | */
|
---|
| 162 | public function fetchReadWriteToken($gitRepositoryLink, FetchReadWriteTokenRequest $postBody, $optParams = [])
|
---|
| 163 | {
|
---|
| 164 | $params = ['gitRepositoryLink' => $gitRepositoryLink, 'postBody' => $postBody];
|
---|
| 165 | $params = array_merge($params, $optParams);
|
---|
| 166 | return $this->call('fetchReadWriteToken', [$params], FetchReadWriteTokenResponse::class);
|
---|
| 167 | }
|
---|
| 168 | /**
|
---|
| 169 | * Gets details of a single GitRepositoryLink. (gitRepositoryLinks.get)
|
---|
| 170 | *
|
---|
| 171 | * @param string $name Required. Name of the resource
|
---|
| 172 | * @param array $optParams Optional parameters.
|
---|
| 173 | * @return GitRepositoryLink
|
---|
| 174 | * @throws \Google\Service\Exception
|
---|
| 175 | */
|
---|
| 176 | public function get($name, $optParams = [])
|
---|
| 177 | {
|
---|
| 178 | $params = ['name' => $name];
|
---|
| 179 | $params = array_merge($params, $optParams);
|
---|
| 180 | return $this->call('get', [$params], GitRepositoryLink::class);
|
---|
| 181 | }
|
---|
| 182 | /**
|
---|
| 183 | * Lists GitRepositoryLinks in a given project, location, and connection.
|
---|
| 184 | * (gitRepositoryLinks.listProjectsLocationsConnectionsGitRepositoryLinks)
|
---|
| 185 | *
|
---|
| 186 | * @param string $parent Required. Parent value for
|
---|
| 187 | * ListGitRepositoryLinksRequest
|
---|
| 188 | * @param array $optParams Optional parameters.
|
---|
| 189 | *
|
---|
| 190 | * @opt_param string filter Optional. Filtering results
|
---|
| 191 | * @opt_param string orderBy Optional. Hint for how to order the results
|
---|
| 192 | * @opt_param int pageSize Optional. Requested page size. Server may return
|
---|
| 193 | * fewer items than requested. If unspecified, server will pick an appropriate
|
---|
| 194 | * default.
|
---|
| 195 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
| 196 | * the server should return.
|
---|
| 197 | * @return ListGitRepositoryLinksResponse
|
---|
| 198 | * @throws \Google\Service\Exception
|
---|
| 199 | */
|
---|
| 200 | public function listProjectsLocationsConnectionsGitRepositoryLinks($parent, $optParams = [])
|
---|
| 201 | {
|
---|
| 202 | $params = ['parent' => $parent];
|
---|
| 203 | $params = array_merge($params, $optParams);
|
---|
| 204 | return $this->call('list', [$params], ListGitRepositoryLinksResponse::class);
|
---|
| 205 | }
|
---|
| 206 | /**
|
---|
| 207 | * ProcessGitLabEnterpriseWebhook is called by the external GitLab Enterprise
|
---|
| 208 | * instances for notifying events.
|
---|
| 209 | * (gitRepositoryLinks.processGitLabEnterpriseWebhook)
|
---|
| 210 | *
|
---|
| 211 | * @param string $name Required. The GitRepositoryLink resource where the
|
---|
| 212 | * webhook will be received. Format:
|
---|
| 213 | * `projects/locations/connections/gitRepositoryLinks`.
|
---|
| 214 | * @param ProcessGitLabEnterpriseWebhookRequest $postBody
|
---|
| 215 | * @param array $optParams Optional parameters.
|
---|
| 216 | * @return DeveloperconnectEmpty
|
---|
| 217 | * @throws \Google\Service\Exception
|
---|
| 218 | */
|
---|
| 219 | public function processGitLabEnterpriseWebhook($name, ProcessGitLabEnterpriseWebhookRequest $postBody, $optParams = [])
|
---|
| 220 | {
|
---|
| 221 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 222 | $params = array_merge($params, $optParams);
|
---|
| 223 | return $this->call('processGitLabEnterpriseWebhook', [$params], DeveloperconnectEmpty::class);
|
---|
| 224 | }
|
---|
| 225 | /**
|
---|
| 226 | * ProcessGitLabWebhook is called by the GitLab.com for notifying events.
|
---|
| 227 | * (gitRepositoryLinks.processGitLabWebhook)
|
---|
| 228 | *
|
---|
| 229 | * @param string $name Required. The GitRepositoryLink resource where the
|
---|
| 230 | * webhook will be received. Format:
|
---|
| 231 | * `projects/locations/connections/gitRepositoryLinks`.
|
---|
| 232 | * @param ProcessGitLabWebhookRequest $postBody
|
---|
| 233 | * @param array $optParams Optional parameters.
|
---|
| 234 | * @return DeveloperconnectEmpty
|
---|
| 235 | * @throws \Google\Service\Exception
|
---|
| 236 | */
|
---|
| 237 | public function processGitLabWebhook($name, ProcessGitLabWebhookRequest $postBody, $optParams = [])
|
---|
| 238 | {
|
---|
| 239 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 240 | $params = array_merge($params, $optParams);
|
---|
| 241 | return $this->call('processGitLabWebhook', [$params], DeveloperconnectEmpty::class);
|
---|
| 242 | }
|
---|
| 243 | }
|
---|
| 244 |
|
---|
| 245 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 246 | class_alias(ProjectsLocationsConnectionsGitRepositoryLinks::class, 'Google_Service_DeveloperConnect_Resource_ProjectsLocationsConnectionsGitRepositoryLinks');
|
---|