1#include <userver/s3api/models/s3api_connection_type.hpp>
3#include <userver/formats/json/value.hpp>
4#include <userver/utils/assert.hpp>
10S3ConnectionType Parse(
const formats::
json::Value& elem, formats::
parse::
To<S3ConnectionType>) {
11 const auto as_string = elem.As<std::string>();
12 if (as_string ==
"http") {
13 return S3ConnectionType::kHttp;
15 if (as_string ==
"https") {
16 return S3ConnectionType::kHttps;
18 UINVARIANT(
false,
"invalid value of connection_type");
21std::string_view ToStringView(S3ConnectionType connection_type) {
22 switch (connection_type) {
23 case S3ConnectionType::kHttp:
25 case S3ConnectionType::kHttps:
31std::string ToString(S3ConnectionType connection_type) {
return std::string{ToStringView(connection_type)}; }