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\ArtifactRegistry\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\ArtifactRegistry\Attachment;
|
---|
21 | use Google\Service\ArtifactRegistry\ListAttachmentsResponse;
|
---|
22 | use Google\Service\ArtifactRegistry\Operation;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "attachments" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $artifactregistryService = new Google\Service\ArtifactRegistry(...);
|
---|
29 | * $attachments = $artifactregistryService->projects_locations_repositories_attachments;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsRepositoriesAttachments extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates an attachment. The returned Operation will finish once the attachment
|
---|
36 | * has been created. Its response will be the created attachment.
|
---|
37 | * (attachments.create)
|
---|
38 | *
|
---|
39 | * @param string $parent Required. The name of the parent resource where the
|
---|
40 | * attachment will be created.
|
---|
41 | * @param Attachment $postBody
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | *
|
---|
44 | * @opt_param string attachmentId Required. The attachment id to use for this
|
---|
45 | * attachment.
|
---|
46 | * @return Operation
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function create($parent, Attachment $postBody, $optParams = [])
|
---|
50 | {
|
---|
51 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
52 | $params = array_merge($params, $optParams);
|
---|
53 | return $this->call('create', [$params], Operation::class);
|
---|
54 | }
|
---|
55 | /**
|
---|
56 | * Deletes an attachment. The returned Operation will finish once the
|
---|
57 | * attachments has been deleted. It will not have any Operation metadata and
|
---|
58 | * will return a `google.protobuf.Empty` response. (attachments.delete)
|
---|
59 | *
|
---|
60 | * @param string $name Required. The name of the attachment to delete.
|
---|
61 | * @param array $optParams Optional parameters.
|
---|
62 | * @return Operation
|
---|
63 | * @throws \Google\Service\Exception
|
---|
64 | */
|
---|
65 | public function delete($name, $optParams = [])
|
---|
66 | {
|
---|
67 | $params = ['name' => $name];
|
---|
68 | $params = array_merge($params, $optParams);
|
---|
69 | return $this->call('delete', [$params], Operation::class);
|
---|
70 | }
|
---|
71 | /**
|
---|
72 | * Gets an attachment. (attachments.get)
|
---|
73 | *
|
---|
74 | * @param string $name Required. The name of the attachment to retrieve.
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | * @return Attachment
|
---|
77 | * @throws \Google\Service\Exception
|
---|
78 | */
|
---|
79 | public function get($name, $optParams = [])
|
---|
80 | {
|
---|
81 | $params = ['name' => $name];
|
---|
82 | $params = array_merge($params, $optParams);
|
---|
83 | return $this->call('get', [$params], Attachment::class);
|
---|
84 | }
|
---|
85 | /**
|
---|
86 | * Lists attachments. (attachments.listProjectsLocationsRepositoriesAttachments)
|
---|
87 | *
|
---|
88 | * @param string $parent Required. The name of the parent resource whose
|
---|
89 | * attachments will be listed.
|
---|
90 | * @param array $optParams Optional parameters.
|
---|
91 | *
|
---|
92 | * @opt_param string filter Optional. An expression for filtering the results of
|
---|
93 | * the request. Filter rules are case insensitive. The fields eligible for
|
---|
94 | * filtering are: * `target` * `type` * `attachment_namespace`
|
---|
95 | * @opt_param int pageSize The maximum number of attachments to return. Maximum
|
---|
96 | * page size is 1,000.
|
---|
97 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
98 | * previous list request, if any.
|
---|
99 | * @return ListAttachmentsResponse
|
---|
100 | * @throws \Google\Service\Exception
|
---|
101 | */
|
---|
102 | public function listProjectsLocationsRepositoriesAttachments($parent, $optParams = [])
|
---|
103 | {
|
---|
104 | $params = ['parent' => $parent];
|
---|
105 | $params = array_merge($params, $optParams);
|
---|
106 | return $this->call('list', [$params], ListAttachmentsResponse::class);
|
---|
107 | }
|
---|
108 | }
|
---|
109 |
|
---|
110 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
111 | class_alias(ProjectsLocationsRepositoriesAttachments::class, 'Google_Service_ArtifactRegistry_Resource_ProjectsLocationsRepositoriesAttachments');
|
---|