Debian Codegraph @

crt/aws-c-sdkutils/include/aws/sdkutils/resource_name.h

raw symbols SCIP
1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5 #ifndef AWS_SDKUTILS_RESOURCE_NAME_H
6 #define AWS_SDKUTILS_RESOURCE_NAME_H
7 #pragma once
8
9 #include <aws/sdkutils/sdkutils.h>
10
11 #include <aws/common/byte_buf.h>
12
13 AWS_PUSH_SANE_WARNING_LEVEL
14
15 struct aws_resource_name {
16 struct aws_byte_cursor partition;
17 struct aws_byte_cursor service;
18 struct aws_byte_cursor region;
19 struct aws_byte_cursor account_id;
20 struct aws_byte_cursor resource_id;
21 };
22
23 AWS_EXTERN_C_BEGIN
24
25 /**
26 Given an ARN "Amazon Resource Name" represented as an in memory a
27 structure representing the parts
28 */
29 AWS_SDKUTILS_API
30 int aws_resource_name_init_from_cur(struct aws_resource_name *arn, const struct aws_byte_cursor *input);
31
32 /**
33 Calculates the space needed to write an ARN to a byte buf
34 */
35 AWS_SDKUTILS_API
36 int aws_resource_name_length(const struct aws_resource_name *arn, size_t *size);
37
38 /**
39 Serializes an ARN structure into the lexical string format
40 */
41 AWS_SDKUTILS_API
42 int aws_byte_buf_append_resource_name(struct aws_byte_buf *buf, const struct aws_resource_name *arn);
43
44 AWS_EXTERN_C_END
45 AWS_POP_SANE_WARNING_LEVEL
46
47 #endif /* AWS_SDKUTILS_RESOURCE_NAME_H */