amazonka-comprehend-2.0: Amazon Comprehend SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.Comprehend.PutResourcePolicy

Description

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

Creating a Request

data PutResourcePolicy Source #

See: newPutResourcePolicy smart constructor.

Constructors

PutResourcePolicy' 

Fields

  • policyRevisionId :: Maybe Text

    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.

  • resourceArn :: Text

    The Amazon Resource Name (ARN) of the custom model to attach the policy to.

  • resourcePolicy :: Text

    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"]}'

Instances

Instances details
ToJSON PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

ToHeaders PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

ToPath PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

ToQuery PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

AWSRequest PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

Associated Types

type AWSResponse PutResourcePolicy #

Generic PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

Associated Types

type Rep PutResourcePolicy :: Type -> Type #

Read PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

Show PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

NFData PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

Methods

rnf :: PutResourcePolicy -> () #

Eq PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

Hashable PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

type AWSResponse PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

type Rep PutResourcePolicy Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

type Rep PutResourcePolicy = D1 ('MetaData "PutResourcePolicy" "Amazonka.Comprehend.PutResourcePolicy" "amazonka-comprehend-2.0-Ko6GCjAQF2RARapSdPn69F" 'False) (C1 ('MetaCons "PutResourcePolicy'" 'PrefixI 'True) (S1 ('MetaSel ('Just "policyRevisionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "resourceArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "resourcePolicy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))

newPutResourcePolicy Source #

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.

Constructors

PutResourcePolicyResponse' 

Fields

  • policyRevisionId :: Maybe Text

    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.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic PutResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

Associated Types

type Rep PutResourcePolicyResponse :: Type -> Type #

Read PutResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

Show PutResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

NFData PutResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

Eq PutResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

type Rep PutResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.Comprehend.PutResourcePolicy

type Rep PutResourcePolicyResponse = D1 ('MetaData "PutResourcePolicyResponse" "Amazonka.Comprehend.PutResourcePolicy" "amazonka-comprehend-2.0-Ko6GCjAQF2RARapSdPn69F" 'False) (C1 ('MetaCons "PutResourcePolicyResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "policyRevisionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

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.