pub struct PutResourcePolicy { /* private fields */ }Expand description
Fluent builder constructing a request to PutResourcePolicy.
Attaches a resource-based policy to a custom model. You can use this policy to authorize an entity in another AWS account to import the custom model, which replicates it in Amazon Comprehend in their account.
Implementations
sourceimpl PutResourcePolicy
impl PutResourcePolicy
sourcepub async fn customize(
self
) -> Result<CustomizableOperation<PutResourcePolicy, AwsResponseRetryClassifier>, SdkError<PutResourcePolicyError>>
pub async fn customize(
self
) -> Result<CustomizableOperation<PutResourcePolicy, AwsResponseRetryClassifier>, SdkError<PutResourcePolicyError>>
Consume this builder, creating a customizable operation that can be modified before being sent. The operation’s inner http::Request can be modified as well.
sourcepub async fn send(
self
) -> Result<PutResourcePolicyOutput, SdkError<PutResourcePolicyError>>
pub async fn send(
self
) -> Result<PutResourcePolicyOutput, SdkError<PutResourcePolicyError>>
Sends the request and returns the response.
If an error occurs, an SdkError will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn resource_arn(self, input: impl Into<String>) -> Self
pub fn resource_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the custom model to attach the policy to.
sourcepub fn set_resource_arn(self, input: Option<String>) -> Self
pub fn set_resource_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the custom model to attach the policy to.
sourcepub fn resource_policy(self, input: impl Into<String>) -> Self
pub fn resource_policy(self, input: impl Into<String>) -> Self
The JSON resource-based policy to attach to your custom model. Provide your JSON as a UTF-8 encoded string without line breaks. To provide valid JSON for your policy, enclose the attribute names and values in double quotes. If the JSON body is also enclosed in double quotes, then you must escape the double quotes that are inside the policy:
"{\"attribute\": \"value\", \"attribute\": [\"value\"]}"
To avoid escaping quotes, you can use single quotes to enclose the policy and double quotes to enclose the JSON names and values:
'{"attribute": "value", "attribute": ["value"]}'
sourcepub fn set_resource_policy(self, input: Option<String>) -> Self
pub fn set_resource_policy(self, input: Option<String>) -> Self
The JSON resource-based policy to attach to your custom model. Provide your JSON as a UTF-8 encoded string without line breaks. To provide valid JSON for your policy, enclose the attribute names and values in double quotes. If the JSON body is also enclosed in double quotes, then you must escape the double quotes that are inside the policy:
"{\"attribute\": \"value\", \"attribute\": [\"value\"]}"
To avoid escaping quotes, you can use single quotes to enclose the policy and double quotes to enclose the JSON names and values:
'{"attribute": "value", "attribute": ["value"]}'
sourcepub fn policy_revision_id(self, input: impl Into<String>) -> Self
pub fn policy_revision_id(self, input: impl Into<String>) -> Self
The revision ID that Amazon Comprehend assigned to the policy that you are updating. If you are creating a new policy that has no prior version, don't use this parameter. Amazon Comprehend creates the revision ID for you.
sourcepub fn set_policy_revision_id(self, input: Option<String>) -> Self
pub fn set_policy_revision_id(self, input: Option<String>) -> Self
The revision ID that Amazon Comprehend assigned to the policy that you are updating. If you are creating a new policy that has no prior version, don't use this parameter. Amazon Comprehend creates the revision ID for you.
Trait Implementations
sourceimpl Clone for PutResourcePolicy
impl Clone for PutResourcePolicy
sourcefn clone(&self) -> PutResourcePolicy
fn clone(&self) -> PutResourcePolicy
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more