[−][src]Struct pinata_sdk::PinataApi
API struct. Exposes functions to interact with the Pinata API
Methods
impl PinataApi
[src]
pub fn new<S: Into<String>>(
api_key: S,
secret_api_key: S
) -> Result<PinataApi, Error>
[src]
api_key: S,
secret_api_key: S
) -> Result<PinataApi, Error>
Creates a new instance of PinataApi using the provided keys. This function panics if api_key or secret_api_key's are empty/blank
pub async fn test_authentication<'_>(&'_ self) -> Result<(), ApiError>
[src]
Test if your credentials are corrects. It returns an error if credentials are not correct
pub async fn set_hash_pin_policy<'_>(
&'_ self,
policy: HashPinPolicy
) -> Result<(), ApiError>
[src]
&'_ self,
policy: HashPinPolicy
) -> Result<(), ApiError>
Change the pin policy for an individual piece of content.
Changes made via this function only affect the content for the hash passed in. They do not affect a user's account level pin policy.
To read more about pin policies, please check out the Regions and Replications documentation
pub async fn pin_by_hash<'_>(
&'_ self,
hash: PinByHash
) -> Result<PinByHashResult, ApiError>
[src]
&'_ self,
hash: PinByHash
) -> Result<PinByHashResult, ApiError>
Add a hash to Pinata for asynchronous pinning.
Content added through this function is pinned in the background. Fpr this operation to succeed, the content for the hash provided must already be pinned by another node on the IPFS network.
pub async fn get_pin_jobs<'_>(
&'_ self,
filters: PinJobsFilter
) -> Result<PinJobs, ApiError>
[src]
&'_ self,
filters: PinJobsFilter
) -> Result<PinJobs, ApiError>
Retrieve a list of all the pins that are currently in the pin queue for your user
pub async fn pin_json<'_, S>(
&'_ self,
pin_data: PinByJson<S>
) -> Result<PinnedObject, ApiError> where
S: Serialize,
[src]
&'_ self,
pin_data: PinByJson<S>
) -> Result<PinnedObject, ApiError> where
S: Serialize,
Pin any JSON serializable object to Pinata IPFS nodes.
pub async fn pin_file<'_>(
&'_ self,
pin_data: PinByFile
) -> Result<PinnedObject, ApiError>
[src]
&'_ self,
pin_data: PinByFile
) -> Result<PinnedObject, ApiError>
Pin any file or folder to Pinata's IPFS nodes.
To upload a file use PinByFile::new("file_path")
. If file_path is a directory, all the content
of the directory will be uploaded to IPFS and the hash of the parent directory is returned.
If the file cannot be read or directory cannot be read an error will be returned.
pub async fn unpin<'_, '_>(&'_ self, hash: &'_ str) -> Result<(), ApiError>
[src]
Unpin content previously uploaded to the Pinata's IPFS nodes.
pub async fn change_hash_metadata<'_>(
&'_ self,
change: ChangePinMetadata
) -> Result<(), ApiError>
[src]
&'_ self,
change: ChangePinMetadata
) -> Result<(), ApiError>
Change name and custom key values associated for a piece of content stored on Pinata.
pub async fn get_total_user_pinned_data<'_>(
&'_ self
) -> Result<TotalPinnedData, ApiError>
[src]
&'_ self
) -> Result<TotalPinnedData, ApiError>
This endpoint returns the total combined size for all content that you've pinned through Pinata
pub async fn get_pin_list<'_>(
&'_ self,
filters: PinListFilter
) -> Result<PinList, ApiError>
[src]
&'_ self,
filters: PinListFilter
) -> Result<PinList, ApiError>
This returns data on what content the sender has pinned to IPFS from pinata
The purpose of this endpoint is to provide insight into what is being pinned, and how long it has been pinned. The results of this call can be filtered using PinListFilter.
Auto Trait Implementations
impl !RefUnwindSafe for PinataApi
impl Send for PinataApi
impl Sync for PinataApi
impl Unpin for PinataApi
impl !UnwindSafe for PinataApi
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,