| 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\Geospatial\DeleteIp2geoDatasource; |
| 19: | use OpenSearch\Endpoints\Geospatial\GeojsonUploadPost; |
| 20: | use OpenSearch\Endpoints\Geospatial\GeojsonUploadPut; |
| 21: | use OpenSearch\Endpoints\Geospatial\GetIp2geoDatasource; |
| 22: | use OpenSearch\Endpoints\Geospatial\GetUploadStats; |
| 23: | use OpenSearch\Endpoints\Geospatial\PutIp2geoDatasource; |
| 24: | use OpenSearch\Endpoints\Geospatial\PutIp2geoDatasourceSettings; |
| 25: | |
| 26: | /** |
| 27: | * Class GeospatialNamespace |
| 28: | * |
| 29: | * NOTE: This file is autogenerated using util/GenerateEndpoints.php |
| 30: | */ |
| 31: | class GeospatialNamespace extends AbstractNamespace |
| 32: | { |
| 33: | /** |
| 34: | * Delete a specific IP2Geo data source. |
| 35: | * |
| 36: | * $params['name'] = (string) |
| 37: | * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false) |
| 38: | * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false) |
| 39: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
| 40: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
| 41: | * $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 `-`. |
| 42: | * |
| 43: | * @param array $params Associative array of parameters |
| 44: | * @return array |
| 45: | */ |
| 46: | public function deleteIp2geoDatasource(array $params = []) |
| 47: | { |
| 48: | $name = $this->extractArgument($params, 'name'); |
| 49: | |
| 50: | $endpoint = $this->endpointFactory->getEndpoint(DeleteIp2geoDatasource::class); |
| 51: | $endpoint->setParams($params); |
| 52: | $endpoint->setName($name); |
| 53: | |
| 54: | return $this->performRequest($endpoint); |
| 55: | } |
| 56: | |
| 57: | /** |
| 58: | * Use an OpenSearch query to upload `GeoJSON`, operation will fail if index exists.- When type is `geo_point`, only Point geometry is allowed- When type is `geo_shape`, all geometry types are allowed (Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Envelope). |
| 59: | * |
| 60: | * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false) |
| 61: | * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false) |
| 62: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
| 63: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
| 64: | * $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 `-`. |
| 65: | * |
| 66: | * @param array $params Associative array of parameters |
| 67: | * @return array |
| 68: | */ |
| 69: | public function geojsonUploadPost(array $params = []) |
| 70: | { |
| 71: | $body = $this->extractArgument($params, 'body'); |
| 72: | |
| 73: | $endpoint = $this->endpointFactory->getEndpoint(GeojsonUploadPost::class); |
| 74: | $endpoint->setParams($params); |
| 75: | $endpoint->setBody($body); |
| 76: | |
| 77: | return $this->performRequest($endpoint); |
| 78: | } |
| 79: | |
| 80: | /** |
| 81: | * Use an OpenSearch query to upload `GeoJSON` regardless if index exists.- When type is `geo_point`, only Point geometry is allowed- When type is `geo_shape`, all geometry types are allowed (Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, Envelope). |
| 82: | * |
| 83: | * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false) |
| 84: | * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false) |
| 85: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
| 86: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
| 87: | * $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 `-`. |
| 88: | * |
| 89: | * @param array $params Associative array of parameters |
| 90: | * @return array |
| 91: | */ |
| 92: | public function geojsonUploadPut(array $params = []) |
| 93: | { |
| 94: | $body = $this->extractArgument($params, 'body'); |
| 95: | |
| 96: | $endpoint = $this->endpointFactory->getEndpoint(GeojsonUploadPut::class); |
| 97: | $endpoint->setParams($params); |
| 98: | $endpoint->setBody($body); |
| 99: | |
| 100: | return $this->performRequest($endpoint); |
| 101: | } |
| 102: | |
| 103: | /** |
| 104: | * Get one or more IP2Geo data sources, defaulting to returning all if no names specified. |
| 105: | * |
| 106: | * $params['name'] = (array) |
| 107: | * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false) |
| 108: | * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false) |
| 109: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
| 110: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
| 111: | * $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 `-`. |
| 112: | * |
| 113: | * @param array $params Associative array of parameters |
| 114: | * @return array |
| 115: | */ |
| 116: | public function getIp2geoDatasource(array $params = []) |
| 117: | { |
| 118: | $name = $this->extractArgument($params, 'name'); |
| 119: | |
| 120: | $endpoint = $this->endpointFactory->getEndpoint(GetIp2geoDatasource::class); |
| 121: | $endpoint->setParams($params); |
| 122: | $endpoint->setName($name); |
| 123: | |
| 124: | return $this->performRequest($endpoint); |
| 125: | } |
| 126: | |
| 127: | /** |
| 128: | * Retrieves statistics for all geospatial uploads. |
| 129: | * |
| 130: | * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false) |
| 131: | * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false) |
| 132: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
| 133: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
| 134: | * $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 `-`. |
| 135: | * |
| 136: | * @param array $params Associative array of parameters |
| 137: | * @return array |
| 138: | */ |
| 139: | public function getUploadStats(array $params = []) |
| 140: | { |
| 141: | $endpoint = $this->endpointFactory->getEndpoint(GetUploadStats::class); |
| 142: | $endpoint->setParams($params); |
| 143: | |
| 144: | return $this->performRequest($endpoint); |
| 145: | } |
| 146: | |
| 147: | /** |
| 148: | * Create a specific IP2Geo data source.Default values: - `endpoint`: `"https://geoip.maps.opensearch.org/v1/geolite2-city/manifest.json"` - `update_interval_in_days`: 3. |
| 149: | * |
| 150: | * $params['name'] = (string) |
| 151: | * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false) |
| 152: | * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false) |
| 153: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
| 154: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
| 155: | * $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 `-`. |
| 156: | * |
| 157: | * @param array $params Associative array of parameters |
| 158: | * @return array |
| 159: | */ |
| 160: | public function putIp2geoDatasource(array $params = []) |
| 161: | { |
| 162: | $name = $this->extractArgument($params, 'name'); |
| 163: | $body = $this->extractArgument($params, 'body'); |
| 164: | |
| 165: | $endpoint = $this->endpointFactory->getEndpoint(PutIp2geoDatasource::class); |
| 166: | $endpoint->setParams($params); |
| 167: | $endpoint->setName($name); |
| 168: | $endpoint->setBody($body); |
| 169: | |
| 170: | return $this->performRequest($endpoint); |
| 171: | } |
| 172: | |
| 173: | /** |
| 174: | * Update a specific IP2Geo data source. |
| 175: | * |
| 176: | * $params['name'] = (string) |
| 177: | * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false) |
| 178: | * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false) |
| 179: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
| 180: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
| 181: | * $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 `-`. |
| 182: | * |
| 183: | * @param array $params Associative array of parameters |
| 184: | * @return array |
| 185: | */ |
| 186: | public function putIp2geoDatasourceSettings(array $params = []) |
| 187: | { |
| 188: | $name = $this->extractArgument($params, 'name'); |
| 189: | $body = $this->extractArgument($params, 'body'); |
| 190: | |
| 191: | $endpoint = $this->endpointFactory->getEndpoint(PutIp2geoDatasourceSettings::class); |
| 192: | $endpoint->setParams($params); |
| 193: | $endpoint->setName($name); |
| 194: | $endpoint->setBody($body); |
| 195: | |
| 196: | return $this->performRequest($endpoint); |
| 197: | } |
| 198: | |
| 199: | } |
| 200: |