1
2
3
4 #pragma once
5
6 #include <string>
7
8 #include "azure/core/nullable.hpp"
9 #include "azure/storage/common/constants.hpp"
10 #include "azure/storage/common/storage_credential.hpp"
11
12 namespace Azure { namespace Storage {
13
18 enum class SasProtocol
19 {
23 HttpsAndHtttp,
24
28 HttpsOnly,
29 };
30
31 inline std::string SasProtocolToString(SasProtocol protocol)
32 {
33 return protocol == SasProtocol::HttpsAndHtttp ? "https,http" : "https";
34 }
35
40 enum class AccountSasResource
41 {
46 Service = 1,
47
52 Container = 2,
53
58 Object = 4,
59
64 All = ~0,
65 };
66
67 inline AccountSasResource operator|(AccountSasResource lhs, AccountSasResource rhs)
68 {
69 using type = std::underlying_type_t<AccountSasResource>;
70 return static_cast<AccountSasResource>(static_cast<type>(lhs) | static_cast<type>(rhs));
71 }
72
73 inline AccountSasResource operator&(AccountSasResource lhs, AccountSasResource rhs)
74 {
75 using type = std::underlying_type_t<AccountSasResource>;
76 return static_cast<AccountSasResource>(static_cast<type>(lhs) & static_cast<type>(rhs));
77 }
78
82 enum class AccountSasServices
83 {
88 Blobs = 1,
89
94 Queue = 2,
95
100 Files = 4,
101
106 All = ~0,
107 };
108
109 inline AccountSasServices operator|(AccountSasServices lhs, AccountSasServices rhs)
110 {
111 using type = std::underlying_type_t<AccountSasServices>;
112 return static_cast<AccountSasServices>(static_cast<type>(lhs) | static_cast<type>(rhs));
113 }
114
115 inline AccountSasServices operator&(AccountSasServices lhs, AccountSasServices rhs)
116 {
117 using type = std::underlying_type_t<AccountSasServices>;
118 return static_cast<AccountSasServices>(static_cast<type>(lhs) & static_cast<type>(rhs));
119 }
120
124 enum class AccountSasPermissions
125 {
129 Read = 1,
130
134 Write = 2,
135
139 Delete = 4,
140
144 DeleteVersion = 8,
145
149 List = 16,
150
154 Add = 32,
155
159 Create = 64,
160
164 Update = 128,
165
169 Process = 256,
170
174 Tags = 512,
175
179 Filter = 1024,
180
184 All = ~0,
185 };
186
187 inline AccountSasPermissions operator|(AccountSasPermissions lhs, AccountSasPermissions rhs)
188 {
189 using type = std::underlying_type_t<AccountSasPermissions>;
190 return static_cast<AccountSasPermissions>(static_cast<type>(lhs) | static_cast<type>(rhs));
191 }
192
193 inline AccountSasPermissions operator&(AccountSasPermissions lhs, AccountSasPermissions rhs)
194 {
195 using type = std::underlying_type_t<AccountSasPermissions>;
196 return static_cast<AccountSasPermissions>(static_cast<type>(lhs) & static_cast<type>(rhs));
197 }
198
204 {
210
216
222
230
236
242
250
261
262 private:
263 std::string Permissions;
264 };
265
266 }}
ncG1vNJzZmiZqqq%2Fpr%2FDpJuom6Njr627wWeaqKqVY8SqusOorqxmnprBcHDWnplom6ClfKLG1KucZqukpL%2Bis8RmmqilnaS7cH2RZ2dnaF2XsrWtjW5mmpuTpMKvwL6Yqpqrj5SvtrXLnZyrl2idvbGr0qisq5uVY7W1ucs%3D