Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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.
Synopsis
- data PutResourcePolicy = PutResourcePolicy' {}
- newPutResourcePolicy :: Text -> Text -> PutResourcePolicy
- putResourcePolicy_policyRevisionId :: Lens' PutResourcePolicy (Maybe Text)
- putResourcePolicy_resourceArn :: Lens' PutResourcePolicy Text
- putResourcePolicy_resourcePolicy :: Lens' PutResourcePolicy Text
- data PutResourcePolicyResponse = PutResourcePolicyResponse' {}
- newPutResourcePolicyResponse :: Int -> PutResourcePolicyResponse
- putResourcePolicyResponse_policyRevisionId :: Lens' PutResourcePolicyResponse (Maybe Text)
- putResourcePolicyResponse_httpStatus :: Lens' PutResourcePolicyResponse Int
Creating a Request
data PutResourcePolicy Source #
See: newPutResourcePolicy
smart constructor.
PutResourcePolicy' | |
|
Instances
:: Text | |
-> Text | |
-> PutResourcePolicy |
Create a value of PutResourcePolicy
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
PutResourcePolicy
, putResourcePolicy_policyRevisionId
- 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.
$sel:resourceArn:PutResourcePolicy'
, putResourcePolicy_resourceArn
- The Amazon Resource Name (ARN) of the custom model to attach the policy
to.
$sel:resourcePolicy:PutResourcePolicy'
, putResourcePolicy_resourcePolicy
- 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"]}'
Request Lenses
putResourcePolicy_policyRevisionId :: Lens' PutResourcePolicy (Maybe Text) Source #
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.
putResourcePolicy_resourceArn :: Lens' PutResourcePolicy Text Source #
The Amazon Resource Name (ARN) of the custom model to attach the policy to.
putResourcePolicy_resourcePolicy :: Lens' PutResourcePolicy Text Source #
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"]}'
Destructuring the Response
data PutResourcePolicyResponse Source #
See: newPutResourcePolicyResponse
smart constructor.
PutResourcePolicyResponse' | |
|
Instances
newPutResourcePolicyResponse Source #
Create a value of PutResourcePolicyResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
PutResourcePolicy
, putResourcePolicyResponse_policyRevisionId
- The revision ID of the policy. Each time you modify a policy, Amazon
Comprehend assigns a new revision ID, and it deletes the prior version
of the policy.
$sel:httpStatus:PutResourcePolicyResponse'
, putResourcePolicyResponse_httpStatus
- The response's http status code.
Response Lenses
putResourcePolicyResponse_policyRevisionId :: Lens' PutResourcePolicyResponse (Maybe Text) Source #
The revision ID of the policy. Each time you modify a policy, Amazon Comprehend assigns a new revision ID, and it deletes the prior version of the policy.
putResourcePolicyResponse_httpStatus :: Lens' PutResourcePolicyResponse Int Source #
The response's http status code.