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