1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * SPDX-License-Identifier: Apache-2.0
7: *
8: * The OpenSearch Contributors require contributions made to
9: * this file be licensed under the Apache-2.0 license or a
10: * compatible open source license.
11: *
12: * Modifications Copyright OpenSearch Contributors. See
13: * GitHub history for details.
14: */
15:
16: namespace OpenSearch\Namespaces;
17:
18: use OpenSearch\Namespaces\AbstractNamespace;
19:
20: /**
21: * Class NotificationsNamespace
22: *
23: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
24: */
25: class NotificationsNamespace extends AbstractNamespace
26: {
27: /**
28: * Create channel configuration.
29: *
30: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
31: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
32: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
33: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
34: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
35: *
36: * @param array $params Associative array of parameters
37: * @return array
38: */
39: public function createConfig(array $params = [])
40: {
41: $body = $this->extractArgument($params, 'body');
42:
43: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Notifications\CreateConfig::class);
44: $endpoint->setParams($params);
45: $endpoint->setBody($body);
46:
47: return $this->performRequest($endpoint);
48: }
49:
50: /**
51: * Delete a channel configuration.
52: *
53: * $params['config_id'] = (string) The ID of the channel configuration to delete.
54: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
55: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
56: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
57: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
58: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
59: *
60: * @param array $params Associative array of parameters
61: * @return array
62: */
63: public function deleteConfig(array $params = [])
64: {
65: $config_id = $this->extractArgument($params, 'config_id');
66:
67: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Notifications\DeleteConfig::class);
68: $endpoint->setParams($params);
69: $endpoint->setConfigId($config_id);
70:
71: return $this->performRequest($endpoint);
72: }
73:
74: /**
75: * Delete multiple channel configurations.
76: *
77: * $params['config_id'] = (string) The ID of the channel configuration to delete.
78: * $params['config_id_list'] = (string) A comma-separated list of channel IDs to delete.
79: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
80: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
81: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
82: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
83: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
84: *
85: * @param array $params Associative array of parameters
86: * @return array
87: */
88: public function deleteConfigs(array $params = [])
89: {
90: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Notifications\DeleteConfigs::class);
91: $endpoint->setParams($params);
92:
93: return $this->performRequest($endpoint);
94: }
95:
96: /**
97: * Get a specific channel configuration.
98: *
99: * $params['config_id'] = (string)
100: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
101: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
102: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
103: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
104: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
105: *
106: * @param array $params Associative array of parameters
107: * @return array
108: */
109: public function getConfig(array $params = [])
110: {
111: $config_id = $this->extractArgument($params, 'config_id');
112:
113: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Notifications\GetConfig::class);
114: $endpoint->setParams($params);
115: $endpoint->setConfigId($config_id);
116:
117: return $this->performRequest($endpoint);
118: }
119:
120: /**
121: * Get multiple channel configurations with filtering.
122: *
123: * $params['chime.url'] = (string)
124: * $params['chime.url.keyword'] = (string)
125: * $params['config_id'] = (string) Notification configuration ID.
126: * $params['config_id_list'] = (array) Notification configuration IDs.
127: * $params['config_type'] = (enum) Type of notification configuration. (Options = chime,email,email_group,microsoft_teams,ses_account,slack,smtp_account,sns,webhook)
128: * $params['created_time_ms'] = (integer)
129: * $params['description'] = (string)
130: * $params['description.keyword'] = (string)
131: * $params['email.email_account_id'] = (string)
132: * $params['email.email_group_id_list'] = (string)
133: * $params['email.recipient_list.recipient'] = (string)
134: * $params['email.recipient_list.recipient.keyword'] = (string)
135: * $params['email_group.recipient_list.recipient'] = (string)
136: * $params['email_group.recipient_list.recipient.keyword'] = (string)
137: * $params['is_enabled'] = (boolean)
138: * $params['last_updated_time_ms'] = (integer)
139: * $params['microsoft_teams.url'] = (string)
140: * $params['microsoft_teams.url.keyword'] = (string)
141: * $params['name'] = (string)
142: * $params['name.keyword'] = (string)
143: * $params['query'] = (string)
144: * $params['ses_account.from_address'] = (string)
145: * $params['ses_account.from_address.keyword'] = (string)
146: * $params['ses_account.region'] = (string)
147: * $params['ses_account.role_arn'] = (string)
148: * $params['ses_account.role_arn.keyword'] = (string)
149: * $params['slack.url'] = (string)
150: * $params['slack.url.keyword'] = (string)
151: * $params['smtp_account.from_address'] = (string)
152: * $params['smtp_account.from_address.keyword'] = (string)
153: * $params['smtp_account.host'] = (string)
154: * $params['smtp_account.host.keyword'] = (string)
155: * $params['smtp_account.method'] = (string)
156: * $params['sns.role_arn'] = (string)
157: * $params['sns.role_arn.keyword'] = (string)
158: * $params['sns.topic_arn'] = (string)
159: * $params['sns.topic_arn.keyword'] = (string)
160: * $params['text_query'] = (string)
161: * $params['webhook.url'] = (string)
162: * $params['webhook.url.keyword'] = (string)
163: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
164: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
165: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
166: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
167: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
168: *
169: * @param array $params Associative array of parameters
170: * @return array
171: */
172: public function getConfigs(array $params = [])
173: {
174: $body = $this->extractArgument($params, 'body');
175:
176: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Notifications\GetConfigs::class);
177: $endpoint->setParams($params);
178: $endpoint->setBody($body);
179:
180: return $this->performRequest($endpoint);
181: }
182:
183: /**
184: * List created notification channels.
185: *
186: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
187: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
188: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
189: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
190: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
191: *
192: * @param array $params Associative array of parameters
193: * @return array
194: */
195: public function listChannels(array $params = [])
196: {
197: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Notifications\ListChannels::class);
198: $endpoint->setParams($params);
199:
200: return $this->performRequest($endpoint);
201: }
202:
203: /**
204: * List supported channel configurations.
205: *
206: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
207: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
208: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
209: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
210: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
211: *
212: * @param array $params Associative array of parameters
213: * @return array
214: */
215: public function listFeatures(array $params = [])
216: {
217: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Notifications\ListFeatures::class);
218: $endpoint->setParams($params);
219:
220: return $this->performRequest($endpoint);
221: }
222:
223: /**
224: * Send a test notification.
225: *
226: * $params['config_id'] = (string)
227: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
228: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
229: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
230: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
231: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
232: *
233: * @param array $params Associative array of parameters
234: * @return array
235: */
236: public function sendTest(array $params = [])
237: {
238: $config_id = $this->extractArgument($params, 'config_id');
239:
240: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Notifications\SendTest::class);
241: $endpoint->setParams($params);
242: $endpoint->setConfigId($config_id);
243:
244: return $this->performRequest($endpoint);
245: }
246:
247: /**
248: * Update channel configuration.
249: *
250: * $params['config_id'] = (string)
251: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
252: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
253: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
254: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
255: * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-".
256: *
257: * @param array $params Associative array of parameters
258: * @return array
259: */
260: public function updateConfig(array $params = [])
261: {
262: $config_id = $this->extractArgument($params, 'config_id');
263: $body = $this->extractArgument($params, 'body');
264:
265: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Notifications\UpdateConfig::class);
266: $endpoint->setParams($params);
267: $endpoint->setConfigId($config_id);
268: $endpoint->setBody($body);
269:
270: return $this->performRequest($endpoint);
271: }
272:
273: }
274: