10 #include <string_view>
15 namespace pinecone::net
30 oss <<
"https://controller." << _environment <<
".pinecone.io";
31 _controller_prefix = oss.
str();
48 [[nodiscard]]
auto prefix() const noexcept ->
std::string_view {
return _controller_prefix; }
56 template <domain::operation_type op>
57 [[nodiscard]]
auto build() const noexcept ->
std::
string
59 if constexpr (domain::op_api_type(op) == domain::api_type::controller) {
60 return _controller_prefix + domain::op_url_fragment(op);
71 template <domain::operation_type op>
74 if constexpr (domain::op_api_type(op) == domain::api_type::service) {
76 oss <<
"https://" << index_name <<
"-" << _metadata.
md_project_name() <<
".svc."
77 << _environment <<
".pinecone.io" << domain::op_url_fragment(op);
Operations made available by the Pinecone API.
Constructs Pinecone API URLs.
url_builder(std::string environment) noexcept
Construct a new url builder object.
auto set_metadata(types::api_metadata metadata) noexcept
Set the API metadata.
auto build(std::string_view index_name) const noexcept -> std::string
Constructs a URL for a specific operation_type requiring an index name.
auto prefix() const noexcept -> std::string_view
auto build() const noexcept -> std::string
Constructs a URL for a specific operation_type.