| 124 | } |
| 125 | |
| 126 | std::string icSelfPath(const NL::json& json) |
| 127 | { |
| 128 | try |
| 129 | { |
| 130 | NL::json links = Utils::jsonValue(json, "links"); |
| 131 | for (const NL::json& link: links) |
| 132 | { |
| 133 | std::string target = Utils::jsonValue<std::string>(link, "rel"); |
| 134 | if (target == "self") |
| 135 | return Utils::jsonValue<std::string>(link, "href"); |
| 136 | } |
| 137 | } |
| 138 | catch(std::runtime_error& ) |
| 139 | { |
| 140 | return ""; |
| 141 | } |
| 142 | |
| 143 | return ""; |
| 144 | } |
| 145 | |
| 146 | |
| 147 | }//StacUtils |