| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
#ifndef AWS_SDKUTILS_AWS_PROFILE_H |
| 7 |
#define AWS_SDKUTILS_AWS_PROFILE_H |
| 8 |
#include <aws/sdkutils/sdkutils.h> |
| 9 |
|
| 10 |
AWS_PUSH_SANE_WARNING_LEVEL |
| 11 |
|
| 12 |
struct aws_allocator; |
| 13 |
struct aws_string; |
| 14 |
struct aws_byte_buf; |
| 15 |
struct aws_byte_cursor; |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
struct aws_profile_property; |
| 31 |
struct aws_profile; |
| 32 |
struct aws_profile_collection; |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
enum aws_profile_source_type { AWS_PST_NONE, AWS_PST_CONFIG, AWS_PST_CREDENTIALS }; |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
enum aws_profile_section_type { |
| 44 |
AWS_PROFILE_SECTION_TYPE_PROFILE, |
| 45 |
AWS_PROFILE_SECTION_TYPE_SSO_SESSION, |
| 46 |
AWS_PROFILE_SECTION_TYPE_SERVICES, |
| 47 |
|
| 48 |
AWS_PROFILE_SECTION_TYPE_COUNT, |
| 49 |
}; |
| 50 |
|
| 51 |
AWS_EXTERN_C_BEGIN |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
AWS_SDKUTILS_API |
| 63 |
struct aws_profile_collection *aws_profile_collection_acquire(struct aws_profile_collection *collection); |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
AWS_SDKUTILS_API |
| 70 |
struct aws_profile_collection *aws_profile_collection_release(struct aws_profile_collection *collection); |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
AWS_SDKUTILS_API |
| 76 |
void aws_profile_collection_destroy(struct aws_profile_collection *profile_collection); |
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
AWS_SDKUTILS_API |
| 82 |
struct aws_profile_collection *aws_profile_collection_new_from_file( |
| 83 |
struct aws_allocator *allocator, |
| 84 |
const struct aws_string *file_path, |
| 85 |
enum aws_profile_source_type source); |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
AWS_SDKUTILS_API |
| 92 |
struct aws_profile_collection *aws_profile_collection_new_from_merge( |
| 93 |
struct aws_allocator *allocator, |
| 94 |
const struct aws_profile_collection *config_profiles, |
| 95 |
const struct aws_profile_collection *credentials_profiles); |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
AWS_SDKUTILS_API |
| 102 |
struct aws_profile_collection *aws_profile_collection_new_from_buffer( |
| 103 |
struct aws_allocator *allocator, |
| 104 |
const struct aws_byte_buf *buffer, |
| 105 |
enum aws_profile_source_type source); |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
AWS_SDKUTILS_API |
| 111 |
const struct aws_profile *aws_profile_collection_get_profile( |
| 112 |
const struct aws_profile_collection *profile_collection, |
| 113 |
const struct aws_string *profile_name); |
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
AWS_SDKUTILS_API |
| 120 |
const struct aws_profile *aws_profile_collection_get_section( |
| 121 |
const struct aws_profile_collection *profile_collection, |
| 122 |
const enum aws_profile_section_type section_type, |
| 123 |
const struct aws_string *section_name); |
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
AWS_SDKUTILS_API |
| 129 |
size_t aws_profile_collection_get_profile_count(const struct aws_profile_collection *profile_collection); |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
AWS_SDKUTILS_API |
| 135 |
size_t aws_profile_collection_get_section_count( |
| 136 |
const struct aws_profile_collection *profile_collection, |
| 137 |
const enum aws_profile_section_type section_type); |
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
AWS_SDKUTILS_API |
| 143 |
const struct aws_string *aws_profile_get_name(const struct aws_profile *profile); |
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
AWS_SDKUTILS_API |
| 153 |
const struct aws_profile_property *aws_profile_get_property( |
| 154 |
const struct aws_profile *profile, |
| 155 |
const struct aws_string *property_name); |
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
AWS_SDKUTILS_API |
| 161 |
size_t aws_profile_get_property_count(const struct aws_profile *profile); |
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
AWS_SDKUTILS_API |
| 167 |
const struct aws_string *aws_profile_property_get_value(const struct aws_profile_property *property); |
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
AWS_SDKUTILS_API |
| 177 |
const struct aws_string *aws_profile_property_get_sub_property( |
| 178 |
const struct aws_profile_property *property, |
| 179 |
const struct aws_string *sub_property_name); |
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
AWS_SDKUTILS_API |
| 185 |
size_t aws_profile_property_get_sub_property_count(const struct aws_profile_property *property); |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
AWS_SDKUTILS_API |
| 198 |
struct aws_string *aws_get_credentials_file_path( |
| 199 |
struct aws_allocator *allocator, |
| 200 |
const struct aws_byte_cursor *override_path); |
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
AWS_SDKUTILS_API |
| 209 |
struct aws_string *aws_get_config_file_path( |
| 210 |
struct aws_allocator *allocator, |
| 211 |
const struct aws_byte_cursor *override_path); |
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
AWS_SDKUTILS_API |
| 217 |
struct aws_string *aws_get_profile_name(struct aws_allocator *allocator, const struct aws_byte_cursor *override_name); |
| 218 |
|
| 219 |
AWS_EXTERN_C_END |
| 220 |
AWS_POP_SANE_WARNING_LEVEL |
| 221 |
|
| 222 |
#endif |