| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
#ifndef AWS_SDKUTILS_ENDPOINTS_RULESET_H |
| 7 |
#define AWS_SDKUTILS_ENDPOINTS_RULESET_H |
| 8 |
|
| 9 |
#include <aws/common/byte_buf.h> |
| 10 |
#include <aws/sdkutils/sdkutils.h> |
| 11 |
|
| 12 |
AWS_PUSH_SANE_WARNING_LEVEL |
| 13 |
|
| 14 |
struct aws_endpoints_ruleset; |
| 15 |
struct aws_partitions_config; |
| 16 |
struct aws_endpoints_parameter; |
| 17 |
struct aws_endpoints_rule_engine; |
| 18 |
struct aws_endpoints_resolved_endpoint; |
| 19 |
struct aws_endpoints_request_context; |
| 20 |
struct aws_hash_table; |
| 21 |
|
| 22 |
enum aws_endpoints_parameter_type { |
| 23 |
AWS_ENDPOINTS_PARAMETER_STRING, |
| 24 |
AWS_ENDPOINTS_PARAMETER_BOOLEAN, |
| 25 |
AWS_ENDPOINTS_PARAMETER_STRING_ARRAY, |
| 26 |
}; |
| 27 |
enum aws_endpoints_resolved_endpoint_type { AWS_ENDPOINTS_RESOLVED_ENDPOINT, AWS_ENDPOINTS_RESOLVED_ERROR }; |
| 28 |
|
| 29 |
AWS_EXTERN_C_BEGIN |
| 30 |
|
| 31 |
AWS_SDKUTILS_API struct aws_byte_cursor aws_endpoints_get_supported_ruleset_version(void); |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
AWS_SDKUTILS_API enum aws_endpoints_parameter_type aws_endpoints_parameter_get_type( |
| 49 |
const struct aws_endpoints_parameter *parameter); |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
AWS_SDKUTILS_API struct aws_byte_cursor aws_endpoints_parameter_get_built_in( |
| 58 |
const struct aws_endpoints_parameter *parameter); |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
AWS_SDKUTILS_API int aws_endpoints_parameter_get_default_string( |
| 68 |
const struct aws_endpoints_parameter *parameter, |
| 69 |
struct aws_byte_cursor *out_cursor); |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
AWS_SDKUTILS_API int aws_endpoints_parameter_get_default_boolean( |
| 78 |
const struct aws_endpoints_parameter *parameter, |
| 79 |
const bool **out_bool); |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
AWS_SDKUTILS_API bool aws_endpoints_parameter_get_is_required(const struct aws_endpoints_parameter *parameter); |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
AWS_SDKUTILS_API struct aws_byte_cursor aws_endpoints_parameter_get_documentation( |
| 92 |
const struct aws_endpoints_parameter *parameter); |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
AWS_SDKUTILS_API bool aws_endpoints_parameters_get_is_deprecated(const struct aws_endpoints_parameter *parameter); |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
AWS_SDKUTILS_API struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_message( |
| 104 |
const struct aws_endpoints_parameter *parameter); |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
AWS_SDKUTILS_API struct aws_byte_cursor aws_endpoints_parameter_get_deprecated_since( |
| 111 |
const struct aws_endpoints_parameter *parameter); |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
AWS_SDKUTILS_API struct aws_endpoints_ruleset *aws_endpoints_ruleset_new_from_string( |
| 124 |
struct aws_allocator *allocator, |
| 125 |
struct aws_byte_cursor ruleset_json); |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
AWS_SDKUTILS_API struct aws_endpoints_ruleset *aws_endpoints_ruleset_acquire(struct aws_endpoints_ruleset *ruleset); |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
AWS_SDKUTILS_API struct aws_endpoints_ruleset *aws_endpoints_ruleset_release(struct aws_endpoints_ruleset *ruleset); |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
AWS_SDKUTILS_API const struct aws_hash_table *aws_endpoints_ruleset_get_parameters( |
| 151 |
struct aws_endpoints_ruleset *ruleset); |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
AWS_SDKUTILS_API struct aws_byte_cursor aws_endpoints_ruleset_get_version(const struct aws_endpoints_ruleset *ruleset); |
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
AWS_SDKUTILS_API struct aws_byte_cursor aws_endpoints_ruleset_get_service_id( |
| 166 |
const struct aws_endpoints_ruleset *ruleset); |
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
AWS_SDKUTILS_API struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_new( |
| 179 |
struct aws_allocator *allocator, |
| 180 |
struct aws_endpoints_ruleset *ruleset, |
| 181 |
struct aws_partitions_config *partitions_config); |
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
AWS_SDKUTILS_API struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_acquire( |
| 187 |
struct aws_endpoints_rule_engine *rule_engine); |
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
AWS_SDKUTILS_API struct aws_endpoints_rule_engine *aws_endpoints_rule_engine_release( |
| 193 |
struct aws_endpoints_rule_engine *rule_engine); |
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
AWS_SDKUTILS_API struct aws_endpoints_request_context *aws_endpoints_request_context_new( |
| 206 |
struct aws_allocator *allocator); |
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
AWS_SDKUTILS_API struct aws_endpoints_request_context *aws_endpoints_request_context_acquire( |
| 212 |
struct aws_endpoints_request_context *request_context); |
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
AWS_SDKUTILS_API struct aws_endpoints_request_context *aws_endpoints_request_context_release( |
| 218 |
struct aws_endpoints_request_context *request_context); |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
AWS_SDKUTILS_API int aws_endpoints_request_context_add_string( |
| 227 |
struct aws_allocator *allocator, |
| 228 |
struct aws_endpoints_request_context *context, |
| 229 |
struct aws_byte_cursor name, |
| 230 |
struct aws_byte_cursor value); |
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
AWS_SDKUTILS_API int aws_endpoints_request_context_add_boolean( |
| 238 |
struct aws_allocator *allocator, |
| 239 |
struct aws_endpoints_request_context *context, |
| 240 |
struct aws_byte_cursor name, |
| 241 |
bool value); |
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
AWS_SDKUTILS_API int aws_endpoints_request_context_add_string_array( |
| 250 |
struct aws_allocator *allocator, |
| 251 |
struct aws_endpoints_request_context *context, |
| 252 |
struct aws_byte_cursor name, |
| 253 |
const struct aws_byte_cursor *value_array, |
| 254 |
size_t len); |
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
AWS_SDKUTILS_API int aws_endpoints_rule_engine_resolve( |
| 263 |
struct aws_endpoints_rule_engine *engine, |
| 264 |
const struct aws_endpoints_request_context *context, |
| 265 |
struct aws_endpoints_resolved_endpoint **out_resolved_endpoint); |
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
AWS_SDKUTILS_API struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_acquire( |
| 271 |
struct aws_endpoints_resolved_endpoint *resolved_endpoint); |
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
AWS_SDKUTILS_API struct aws_endpoints_resolved_endpoint *aws_endpoints_resolved_endpoint_release( |
| 277 |
struct aws_endpoints_resolved_endpoint *resolved_endpoint); |
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
AWS_SDKUTILS_API enum aws_endpoints_resolved_endpoint_type aws_endpoints_resolved_endpoint_get_type( |
| 283 |
const struct aws_endpoints_resolved_endpoint *resolved_endpoint); |
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
AWS_SDKUTILS_API int aws_endpoints_resolved_endpoint_get_url( |
| 290 |
const struct aws_endpoints_resolved_endpoint *resolved_endpoint, |
| 291 |
struct aws_byte_cursor *out_url); |
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
AWS_SDKUTILS_API int aws_endpoints_resolved_endpoint_get_properties( |
| 301 |
const struct aws_endpoints_resolved_endpoint *resolved_endpoint, |
| 302 |
struct aws_byte_cursor *out_properties); |
| 303 |
|
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
AWS_SDKUTILS_API int aws_endpoints_resolved_endpoint_get_headers( |
| 314 |
const struct aws_endpoints_resolved_endpoint *resolved_endpoint, |
| 315 |
const struct aws_hash_table **out_headers); |
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
AWS_SDKUTILS_API int aws_endpoints_resolved_endpoint_get_error( |
| 322 |
const struct aws_endpoints_resolved_endpoint *resolved_endpoint, |
| 323 |
struct aws_byte_cursor *out_error); |
| 324 |
|
| 325 |
AWS_EXTERN_C_END |
| 326 |
AWS_POP_SANE_WARNING_LEVEL |
| 327 |
|
| 328 |
#endif |