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\Essentialcontacts\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Essentialcontacts\GoogleCloudEssentialcontactsV1ComputeContactsResponse;
|
---|
21 | use Google\Service\Essentialcontacts\GoogleCloudEssentialcontactsV1Contact;
|
---|
22 | use Google\Service\Essentialcontacts\GoogleCloudEssentialcontactsV1ListContactsResponse;
|
---|
23 | use Google\Service\Essentialcontacts\GoogleCloudEssentialcontactsV1SendTestMessageRequest;
|
---|
24 | use Google\Service\Essentialcontacts\GoogleProtobufEmpty;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "contacts" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $essentialcontactsService = new Google\Service\Essentialcontacts(...);
|
---|
31 | * $contacts = $essentialcontactsService->folders_contacts;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class FoldersContacts extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Lists all contacts for the resource that are subscribed to the specified
|
---|
38 | * notification categories, including contacts inherited from any parent
|
---|
39 | * resources. (contacts.compute)
|
---|
40 | *
|
---|
41 | * @param string $parent Required. The name of the resource to compute contacts
|
---|
42 | * for. Format: organizations/{organization_id}, folders/{folder_id} or
|
---|
43 | * projects/{project_id}
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | *
|
---|
46 | * @opt_param string notificationCategories The categories of notifications to
|
---|
47 | * compute contacts for. If ALL is included in this list, contacts subscribed to
|
---|
48 | * any notification category will be returned.
|
---|
49 | * @opt_param int pageSize Optional. The maximum number of results to return
|
---|
50 | * from this request. Non-positive values are ignored. The presence of
|
---|
51 | * `next_page_token` in the response indicates that more results might be
|
---|
52 | * available. If not specified, the default page_size is 100.
|
---|
53 | * @opt_param string pageToken Optional. If present, retrieves the next batch of
|
---|
54 | * results from the preceding call to this method. `page_token` must be the
|
---|
55 | * value of `next_page_token` from the previous response. The values of other
|
---|
56 | * method parameters should be identical to those in the previous call.
|
---|
57 | * @return GoogleCloudEssentialcontactsV1ComputeContactsResponse
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function compute($parent, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['parent' => $parent];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('compute', [$params], GoogleCloudEssentialcontactsV1ComputeContactsResponse::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Adds a new contact for a resource. (contacts.create)
|
---|
68 | *
|
---|
69 | * @param string $parent Required. The resource to save this contact for.
|
---|
70 | * Format: organizations/{organization_id}, folders/{folder_id} or
|
---|
71 | * projects/{project_id}
|
---|
72 | * @param GoogleCloudEssentialcontactsV1Contact $postBody
|
---|
73 | * @param array $optParams Optional parameters.
|
---|
74 | * @return GoogleCloudEssentialcontactsV1Contact
|
---|
75 | * @throws \Google\Service\Exception
|
---|
76 | */
|
---|
77 | public function create($parent, GoogleCloudEssentialcontactsV1Contact $postBody, $optParams = [])
|
---|
78 | {
|
---|
79 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
80 | $params = array_merge($params, $optParams);
|
---|
81 | return $this->call('create', [$params], GoogleCloudEssentialcontactsV1Contact::class);
|
---|
82 | }
|
---|
83 | /**
|
---|
84 | * Deletes a contact. (contacts.delete)
|
---|
85 | *
|
---|
86 | * @param string $name Required. The name of the contact to delete. Format:
|
---|
87 | * organizations/{organization_id}/contacts/{contact_id},
|
---|
88 | * folders/{folder_id}/contacts/{contact_id} or
|
---|
89 | * projects/{project_id}/contacts/{contact_id}
|
---|
90 | * @param array $optParams Optional parameters.
|
---|
91 | * @return GoogleProtobufEmpty
|
---|
92 | * @throws \Google\Service\Exception
|
---|
93 | */
|
---|
94 | public function delete($name, $optParams = [])
|
---|
95 | {
|
---|
96 | $params = ['name' => $name];
|
---|
97 | $params = array_merge($params, $optParams);
|
---|
98 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
99 | }
|
---|
100 | /**
|
---|
101 | * Gets a single contact. (contacts.get)
|
---|
102 | *
|
---|
103 | * @param string $name Required. The name of the contact to retrieve. Format:
|
---|
104 | * organizations/{organization_id}/contacts/{contact_id},
|
---|
105 | * folders/{folder_id}/contacts/{contact_id} or
|
---|
106 | * projects/{project_id}/contacts/{contact_id}
|
---|
107 | * @param array $optParams Optional parameters.
|
---|
108 | * @return GoogleCloudEssentialcontactsV1Contact
|
---|
109 | * @throws \Google\Service\Exception
|
---|
110 | */
|
---|
111 | public function get($name, $optParams = [])
|
---|
112 | {
|
---|
113 | $params = ['name' => $name];
|
---|
114 | $params = array_merge($params, $optParams);
|
---|
115 | return $this->call('get', [$params], GoogleCloudEssentialcontactsV1Contact::class);
|
---|
116 | }
|
---|
117 | /**
|
---|
118 | * Lists the contacts that have been set on a resource.
|
---|
119 | * (contacts.listFoldersContacts)
|
---|
120 | *
|
---|
121 | * @param string $parent Required. The parent resource name. Format:
|
---|
122 | * organizations/{organization_id}, folders/{folder_id} or projects/{project_id}
|
---|
123 | * @param array $optParams Optional parameters.
|
---|
124 | *
|
---|
125 | * @opt_param int pageSize Optional. The maximum number of results to return
|
---|
126 | * from this request. Non-positive values are ignored. The presence of
|
---|
127 | * `next_page_token` in the response indicates that more results might be
|
---|
128 | * available. If not specified, the default page_size is 100.
|
---|
129 | * @opt_param string pageToken Optional. If present, retrieves the next batch of
|
---|
130 | * results from the preceding call to this method. `page_token` must be the
|
---|
131 | * value of `next_page_token` from the previous response. The values of other
|
---|
132 | * method parameters should be identical to those in the previous call.
|
---|
133 | * @return GoogleCloudEssentialcontactsV1ListContactsResponse
|
---|
134 | * @throws \Google\Service\Exception
|
---|
135 | */
|
---|
136 | public function listFoldersContacts($parent, $optParams = [])
|
---|
137 | {
|
---|
138 | $params = ['parent' => $parent];
|
---|
139 | $params = array_merge($params, $optParams);
|
---|
140 | return $this->call('list', [$params], GoogleCloudEssentialcontactsV1ListContactsResponse::class);
|
---|
141 | }
|
---|
142 | /**
|
---|
143 | * Updates a contact. Note: A contact's email address cannot be changed.
|
---|
144 | * (contacts.patch)
|
---|
145 | *
|
---|
146 | * @param string $name Output only. The identifier for the contact. Format:
|
---|
147 | * {resource_type}/{resource_id}/contacts/{contact_id}
|
---|
148 | * @param GoogleCloudEssentialcontactsV1Contact $postBody
|
---|
149 | * @param array $optParams Optional parameters.
|
---|
150 | *
|
---|
151 | * @opt_param string updateMask Optional. The update mask applied to the
|
---|
152 | * resource. For the `FieldMask` definition, see
|
---|
153 | * https://developers.google.com/protocol-
|
---|
154 | * buffers/docs/reference/google.protobuf#fieldmask
|
---|
155 | * @return GoogleCloudEssentialcontactsV1Contact
|
---|
156 | * @throws \Google\Service\Exception
|
---|
157 | */
|
---|
158 | public function patch($name, GoogleCloudEssentialcontactsV1Contact $postBody, $optParams = [])
|
---|
159 | {
|
---|
160 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
161 | $params = array_merge($params, $optParams);
|
---|
162 | return $this->call('patch', [$params], GoogleCloudEssentialcontactsV1Contact::class);
|
---|
163 | }
|
---|
164 | /**
|
---|
165 | * Allows a contact admin to send a test message to contact to verify that it
|
---|
166 | * has been configured correctly. (contacts.sendTestMessage)
|
---|
167 | *
|
---|
168 | * @param string $resource Required. The name of the resource to send the test
|
---|
169 | * message for. All contacts must either be set directly on this resource or
|
---|
170 | * inherited from another resource that is an ancestor of this one. Format:
|
---|
171 | * organizations/{organization_id}, folders/{folder_id} or projects/{project_id}
|
---|
172 | * @param GoogleCloudEssentialcontactsV1SendTestMessageRequest $postBody
|
---|
173 | * @param array $optParams Optional parameters.
|
---|
174 | * @return GoogleProtobufEmpty
|
---|
175 | * @throws \Google\Service\Exception
|
---|
176 | */
|
---|
177 | public function sendTestMessage($resource, GoogleCloudEssentialcontactsV1SendTestMessageRequest $postBody, $optParams = [])
|
---|
178 | {
|
---|
179 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
180 | $params = array_merge($params, $optParams);
|
---|
181 | return $this->call('sendTestMessage', [$params], GoogleProtobufEmpty::class);
|
---|
182 | }
|
---|
183 | }
|
---|
184 |
|
---|
185 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
186 | class_alias(FoldersContacts::class, 'Google_Service_Essentialcontacts_Resource_FoldersContacts');
|
---|