I've been using the async-stripe crate and I'm facing an issue when attempting to retrieve a price object using the Price::retrieve() method.
The retrieve() method expects a PriceId object as an argument, but there doesn't appear to be a way to construct a PriceId object from a string price ID. This is the function signature:
While there are methods to extract the ID as a string, I haven't found a way to construct a PriceId from a string.
I expected there to be a way to create a PriceId object from a string, as the ID is typically how one would reference a price object in the Stripe API.
Am I missing something, or is there currently no way to create a PriceId object from a string? If it's the latter, I would suggest that this functionality be added, as it seems crucial for using the Price::retrieve() function.
I apologize if this is obvious. I'm learning Rust for backend development and this library has been crucial to my project! I appreciate the help!
Hello,
I've been using the
async-stripe
crate and I'm facing an issue when attempting to retrieve a price object using thePrice::retrieve()
method.The
retrieve()
method expects aPriceId
object as an argument, but there doesn't appear to be a way to construct aPriceId
object from a string price ID. This is the function signature:And this is the
PriceId
struct:While there are methods to extract the ID as a string, I haven't found a way to construct a
PriceId
from a string.I expected there to be a way to create a
PriceId
object from a string, as the ID is typically how one would reference a price object in the Stripe API.Am I missing something, or is there currently no way to create a
PriceId
object from a string? If it's the latter, I would suggest that this functionality be added, as it seems crucial for using thePrice::retrieve()
function.I apologize if this is obvious. I'm learning Rust for backend development and this library has been crucial to my project! I appreciate the help!
Describe the solution you'd like
1. Public constructor:
You would then create a
PriceId
object like this:EDIT: Nevermind, I'm a dummy, there's a FromStr trait implemented!
Describe alternatives you've considered
No response
Additional context
No response