pub struct PoliciesClient { /* private fields */ }Expand description
Client for policies operations
Implementations§
Source§impl PoliciesClient
impl PoliciesClient
Sourcepub async fn update<'a>(
&'a self,
policy_id: &'a UpdatePolicyPolicyId,
ctx: &'a AuthorizationContext,
body: &'a UpdatePolicyBody,
) -> Result<ResponseValue<Policy>, PrivySignedApiError>
pub async fn update<'a>( &'a self, policy_id: &'a UpdatePolicyPolicyId, ctx: &'a AuthorizationContext, body: &'a UpdatePolicyBody, ) -> Result<ResponseValue<Policy>, PrivySignedApiError>
Update a policy
§Errors
Can fail either if the authorization signature could not be generated, or if the api call fails whether than be due to network issues, auth problems, or the Privy API returning an error.
Sourcepub async fn delete<'a>(
&'a self,
policy_id: &'a DeletePolicyPolicyId,
ctx: &'a AuthorizationContext,
) -> Result<ResponseValue<DeletePolicyResponse>, PrivySignedApiError>
pub async fn delete<'a>( &'a self, policy_id: &'a DeletePolicyPolicyId, ctx: &'a AuthorizationContext, ) -> Result<ResponseValue<DeletePolicyResponse>, PrivySignedApiError>
Delete a policy
§Errors
Can fail either if the authorization signature could not be generated, or if the api call fails whether than be due to network issues, auth problems, or the Privy API returning an error.
Sourcepub async fn create_rule<'a>(
&'a self,
policy_id: &'a CreateRulePolicyId,
ctx: &'a AuthorizationContext,
body: &'a PolicyRuleRequestBody,
) -> Result<ResponseValue<PolicyRuleResponse>, PrivySignedApiError>
pub async fn create_rule<'a>( &'a self, policy_id: &'a CreateRulePolicyId, ctx: &'a AuthorizationContext, body: &'a PolicyRuleRequestBody, ) -> Result<ResponseValue<PolicyRuleResponse>, PrivySignedApiError>
Create a rule for a policy
§Errors
Can fail either if the authorization signature could not be generated, or if the api call fails whether than be due to network issues, auth problems, or the Privy API returning an error.
Sourcepub async fn update_rule<'a>(
&'a self,
policy_id: &'a UpdateRulePolicyId,
rule_id: &'a UpdateRuleRuleId,
ctx: &'a AuthorizationContext,
body: &'a PolicyRuleRequestBody,
) -> Result<ResponseValue<UpdateRuleResponse>, PrivySignedApiError>
pub async fn update_rule<'a>( &'a self, policy_id: &'a UpdateRulePolicyId, rule_id: &'a UpdateRuleRuleId, ctx: &'a AuthorizationContext, body: &'a PolicyRuleRequestBody, ) -> Result<ResponseValue<UpdateRuleResponse>, PrivySignedApiError>
Update a rule for a policy
§Errors
Can fail either if the authorization signature could not be generated, or if the api call fails whether than be due to network issues, auth problems, or the Privy API returning an error.
Sourcepub async fn delete_rule<'a>(
&'a self,
policy_id: &'a DeleteRulePolicyId,
rule_id: &'a DeleteRuleRuleId,
ctx: &'a AuthorizationContext,
) -> Result<ResponseValue<DeleteRuleResponse>, PrivySignedApiError>
pub async fn delete_rule<'a>( &'a self, policy_id: &'a DeleteRulePolicyId, rule_id: &'a DeleteRuleRuleId, ctx: &'a AuthorizationContext, ) -> Result<ResponseValue<DeleteRuleResponse>, PrivySignedApiError>
Delete a rule for a policy
§Errors
Can fail either if the authorization signature could not be generated, or if the api call fails whether than be due to network issues, auth problems, or the Privy API returning an error.
Source§impl PoliciesClient
impl PoliciesClient
Sourcepub fn new(client: Client, app_id: String, base_url: String) -> Self
pub fn new(client: Client, app_id: String, base_url: String) -> Self
Create a new client instance
Sourcepub async fn create<'a>(
&'a self,
privy_idempotency_key: Option<&'a str>,
body: &'a CreatePolicyBody,
) -> Result<ResponseValue<Policy>, Error<()>>
pub async fn create<'a>( &'a self, privy_idempotency_key: Option<&'a str>, body: &'a CreatePolicyBody, ) -> Result<ResponseValue<Policy>, Error<()>>
Create Policy
Create a new policy.
Sends a POST request to /v1/policies
Sourcepub async fn get<'a>(
&'a self,
policy_id: &'a GetPolicyPolicyId,
) -> Result<ResponseValue<Policy>, Error<()>>
pub async fn get<'a>( &'a self, policy_id: &'a GetPolicyPolicyId, ) -> Result<ResponseValue<Policy>, Error<()>>
Get Policy
Get a policy by policy ID.
Sends a GET request to /v1/policies/{policy_id}
Sourcepub async fn get_rule<'a>(
&'a self,
policy_id: &'a GetRulePolicyId,
rule_id: &'a GetRuleRuleId,
) -> Result<ResponseValue<PolicyRuleResponse>, Error<()>>
pub async fn get_rule<'a>( &'a self, policy_id: &'a GetRulePolicyId, rule_id: &'a GetRuleRuleId, ) -> Result<ResponseValue<PolicyRuleResponse>, Error<()>>
Get Policy Rule
Get a rule by policy ID and rule ID.
Sends a GET request to /v1/policies/{policy_id}/rules/{rule_id}
Sourcepub async fn _update<'a>(
&'a self,
policy_id: &'a UpdatePolicyPolicyId,
privy_authorization_signature: Option<&'a str>,
body: &'a UpdatePolicyBody,
) -> Result<ResponseValue<Policy>, Error<()>>
pub async fn _update<'a>( &'a self, policy_id: &'a UpdatePolicyPolicyId, privy_authorization_signature: Option<&'a str>, body: &'a UpdatePolicyBody, ) -> Result<ResponseValue<Policy>, Error<()>>
Update Policy
Update a policy by policy ID.
Sends a PATCH request to /v1/policies/{policy_id}
Sourcepub async fn _delete<'a>(
&'a self,
policy_id: &'a DeletePolicyPolicyId,
privy_authorization_signature: Option<&'a str>,
) -> Result<ResponseValue<DeletePolicyResponse>, Error<()>>
pub async fn _delete<'a>( &'a self, policy_id: &'a DeletePolicyPolicyId, privy_authorization_signature: Option<&'a str>, ) -> Result<ResponseValue<DeletePolicyResponse>, Error<()>>
Delete Policy
Delete a policy by policy ID.
Sends a DELETE request to /v1/policies/{policy_id}
Sourcepub async fn _create_rule<'a>(
&'a self,
policy_id: &'a CreateRulePolicyId,
privy_authorization_signature: Option<&'a str>,
body: &'a PolicyRuleRequestBody,
) -> Result<ResponseValue<PolicyRuleResponse>, Error<()>>
pub async fn _create_rule<'a>( &'a self, policy_id: &'a CreateRulePolicyId, privy_authorization_signature: Option<&'a str>, body: &'a PolicyRuleRequestBody, ) -> Result<ResponseValue<PolicyRuleResponse>, Error<()>>
Create Policy Rule
Create a new rule for a policy.
Sends a POST request to /v1/policies/{policy_id}/rules
Sourcepub async fn _update_rule<'a>(
&'a self,
policy_id: &'a UpdateRulePolicyId,
rule_id: &'a UpdateRuleRuleId,
privy_authorization_signature: Option<&'a str>,
body: &'a PolicyRuleRequestBody,
) -> Result<ResponseValue<UpdateRuleResponse>, Error<()>>
pub async fn _update_rule<'a>( &'a self, policy_id: &'a UpdateRulePolicyId, rule_id: &'a UpdateRuleRuleId, privy_authorization_signature: Option<&'a str>, body: &'a PolicyRuleRequestBody, ) -> Result<ResponseValue<UpdateRuleResponse>, Error<()>>
Update Policy Rule
Update a rule by policy ID and rule ID.
Sends a PATCH request to /v1/policies/{policy_id}/rules/{rule_id}
Sourcepub async fn _delete_rule<'a>(
&'a self,
policy_id: &'a DeleteRulePolicyId,
rule_id: &'a DeleteRuleRuleId,
privy_authorization_signature: Option<&'a str>,
) -> Result<ResponseValue<DeleteRuleResponse>, Error<()>>
pub async fn _delete_rule<'a>( &'a self, policy_id: &'a DeleteRulePolicyId, rule_id: &'a DeleteRuleRuleId, privy_authorization_signature: Option<&'a str>, ) -> Result<ResponseValue<DeleteRuleResponse>, Error<()>>
Delete Policy Rule
Delete a rule by policy ID and rule ID.
Sends a DELETE request to /v1/policies/{policy_id}/rules/{rule_id}
Trait Implementations§
Source§impl Clone for PoliciesClient
impl Clone for PoliciesClient
Source§fn clone(&self) -> PoliciesClient
fn clone(&self) -> PoliciesClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more