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\CloudBuild\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudBuild\CloudbuildEmpty;
|
---|
21 | use Google\Service\CloudBuild\GitLabConfig;
|
---|
22 | use Google\Service\CloudBuild\ListGitLabConfigsResponse;
|
---|
23 | use Google\Service\CloudBuild\Operation;
|
---|
24 | use Google\Service\CloudBuild\RemoveGitLabConnectedRepositoryRequest;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "gitLabConfigs" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $cloudbuildService = new Google\Service\CloudBuild(...);
|
---|
31 | * $gitLabConfigs = $cloudbuildService->projects_locations_gitLabConfigs;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class ProjectsLocationsGitLabConfigs extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Creates a new `GitLabConfig`. This API is experimental (gitLabConfigs.create)
|
---|
38 | *
|
---|
39 | * @param string $parent Required. Name of the parent resource.
|
---|
40 | * @param GitLabConfig $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string gitlabConfigId Optional. The ID to use for the
|
---|
44 | * GitLabConfig, which will become the final component of the GitLabConfig’s
|
---|
45 | * resource name. gitlab_config_id must meet the following requirements: + They
|
---|
46 | * must contain only alphanumeric characters and dashes. + They can be 1-64
|
---|
47 | * characters long. + They must begin and end with an alphanumeric character
|
---|
48 | * @return Operation
|
---|
49 | */
|
---|
50 | public function create($parent, GitLabConfig $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('create', [$params], Operation::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Delete a `GitLabConfig`. This API is experimental (gitLabConfigs.delete)
|
---|
58 | *
|
---|
59 | * @param string $name Required. The config resource name.
|
---|
60 | * @param array $optParams Optional parameters.
|
---|
61 | * @return Operation
|
---|
62 | */
|
---|
63 | public function delete($name, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['name' => $name];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('delete', [$params], Operation::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Retrieves a `GitLabConfig`. This API is experimental (gitLabConfigs.get)
|
---|
71 | *
|
---|
72 | * @param string $name Required. The config resource name.
|
---|
73 | * @param array $optParams Optional parameters.
|
---|
74 | * @return GitLabConfig
|
---|
75 | */
|
---|
76 | public function get($name, $optParams = [])
|
---|
77 | {
|
---|
78 | $params = ['name' => $name];
|
---|
79 | $params = array_merge($params, $optParams);
|
---|
80 | return $this->call('get', [$params], GitLabConfig::class);
|
---|
81 | }
|
---|
82 | /**
|
---|
83 | * List all `GitLabConfigs` for a given project. This API is experimental
|
---|
84 | * (gitLabConfigs.listProjectsLocationsGitLabConfigs)
|
---|
85 | *
|
---|
86 | * @param string $parent Required. Name of the parent resource
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | *
|
---|
89 | * @opt_param int pageSize The maximum number of configs to return. The service
|
---|
90 | * may return fewer than this value. If unspecified, at most 50 configs will be
|
---|
91 | * returned. The maximum value is 1000;, values above 1000 will be coerced to
|
---|
92 | * 1000.
|
---|
93 | * @opt_param string pageToken A page token, received from a previous
|
---|
94 | * ‘ListGitlabConfigsRequest’ call. Provide this to retrieve the subsequent
|
---|
95 | * page. When paginating, all other parameters provided to
|
---|
96 | * ‘ListGitlabConfigsRequest’ must match the call that provided the page token.
|
---|
97 | * @return ListGitLabConfigsResponse
|
---|
98 | */
|
---|
99 | public function listProjectsLocationsGitLabConfigs($parent, $optParams = [])
|
---|
100 | {
|
---|
101 | $params = ['parent' => $parent];
|
---|
102 | $params = array_merge($params, $optParams);
|
---|
103 | return $this->call('list', [$params], ListGitLabConfigsResponse::class);
|
---|
104 | }
|
---|
105 | /**
|
---|
106 | * Updates an existing `GitLabConfig`. This API is experimental
|
---|
107 | * (gitLabConfigs.patch)
|
---|
108 | *
|
---|
109 | * @param string $name The resource name for the config.
|
---|
110 | * @param GitLabConfig $postBody
|
---|
111 | * @param array $optParams Optional parameters.
|
---|
112 | *
|
---|
113 | * @opt_param string updateMask Update mask for the resource. If this is set,
|
---|
114 | * the server will only update the fields specified in the field mask.
|
---|
115 | * Otherwise, a full update of the mutable resource fields will be performed.
|
---|
116 | * @return Operation
|
---|
117 | */
|
---|
118 | public function patch($name, GitLabConfig $postBody, $optParams = [])
|
---|
119 | {
|
---|
120 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
121 | $params = array_merge($params, $optParams);
|
---|
122 | return $this->call('patch', [$params], Operation::class);
|
---|
123 | }
|
---|
124 | /**
|
---|
125 | * Remove a GitLab repository from a given GitLabConfig's connected
|
---|
126 | * repositories. This API is experimental.
|
---|
127 | * (gitLabConfigs.removeGitLabConnectedRepository)
|
---|
128 | *
|
---|
129 | * @param string $config Required. The name of the `GitLabConfig` to remove a
|
---|
130 | * connected repository. Format:
|
---|
131 | * `projects/{project}/locations/{location}/gitLabConfigs/{config}`
|
---|
132 | * @param RemoveGitLabConnectedRepositoryRequest $postBody
|
---|
133 | * @param array $optParams Optional parameters.
|
---|
134 | * @return CloudbuildEmpty
|
---|
135 | */
|
---|
136 | public function removeGitLabConnectedRepository($config, RemoveGitLabConnectedRepositoryRequest $postBody, $optParams = [])
|
---|
137 | {
|
---|
138 | $params = ['config' => $config, 'postBody' => $postBody];
|
---|
139 | $params = array_merge($params, $optParams);
|
---|
140 | return $this->call('removeGitLabConnectedRepository', [$params], CloudbuildEmpty::class);
|
---|
141 | }
|
---|
142 | }
|
---|
143 |
|
---|
144 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
145 | class_alias(ProjectsLocationsGitLabConfigs::class, 'Google_Service_CloudBuild_Resource_ProjectsLocationsGitLabConfigs');
|
---|