Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Creates an IoT policy.
The created policy is the default version for the policy. This operation creates a policy version with a version identifier of 1 and sets 1 as the policy's default version.
Requires permission to access the CreatePolicy action.
Synopsis
- data CreatePolicy = CreatePolicy' {
- tags :: Maybe [Tag]
- policyName :: Text
- policyDocument :: Text
- newCreatePolicy :: Text -> Text -> CreatePolicy
- createPolicy_tags :: Lens' CreatePolicy (Maybe [Tag])
- createPolicy_policyName :: Lens' CreatePolicy Text
- createPolicy_policyDocument :: Lens' CreatePolicy Text
- data CreatePolicyResponse = CreatePolicyResponse' {}
- newCreatePolicyResponse :: Int -> CreatePolicyResponse
- createPolicyResponse_policyName :: Lens' CreatePolicyResponse (Maybe Text)
- createPolicyResponse_policyDocument :: Lens' CreatePolicyResponse (Maybe Text)
- createPolicyResponse_policyVersionId :: Lens' CreatePolicyResponse (Maybe Text)
- createPolicyResponse_policyArn :: Lens' CreatePolicyResponse (Maybe Text)
- createPolicyResponse_httpStatus :: Lens' CreatePolicyResponse Int
Creating a Request
data CreatePolicy Source #
The input for the CreatePolicy operation.
See: newCreatePolicy
smart constructor.
CreatePolicy' | |
|
Instances
Create a value of CreatePolicy
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:
$sel:tags:CreatePolicy'
, createPolicy_tags
- Metadata which can be used to manage the policy.
For URI Request parameters use format: ...key1=value1&key2=value2...
For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."
For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."
$sel:policyName:CreatePolicy'
, createPolicy_policyName
- The policy name.
$sel:policyDocument:CreatePolicy'
, createPolicy_policyDocument
- The JSON document that describes the policy. policyDocument must
have a minimum length of 1, with a maximum length of 2048, excluding
whitespace.
Request Lenses
createPolicy_tags :: Lens' CreatePolicy (Maybe [Tag]) Source #
Metadata which can be used to manage the policy.
For URI Request parameters use format: ...key1=value1&key2=value2...
For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."
For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."
createPolicy_policyName :: Lens' CreatePolicy Text Source #
The policy name.
createPolicy_policyDocument :: Lens' CreatePolicy Text Source #
The JSON document that describes the policy. policyDocument must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.
Destructuring the Response
data CreatePolicyResponse Source #
The output from the CreatePolicy operation.
See: newCreatePolicyResponse
smart constructor.
CreatePolicyResponse' | |
|
Instances
newCreatePolicyResponse Source #
Create a value of CreatePolicyResponse
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:
$sel:policyName:CreatePolicy'
, createPolicyResponse_policyName
- The policy name.
$sel:policyDocument:CreatePolicy'
, createPolicyResponse_policyDocument
- The JSON document that describes the policy.
$sel:policyVersionId:CreatePolicyResponse'
, createPolicyResponse_policyVersionId
- The policy version ID.
$sel:policyArn:CreatePolicyResponse'
, createPolicyResponse_policyArn
- The policy ARN.
$sel:httpStatus:CreatePolicyResponse'
, createPolicyResponse_httpStatus
- The response's http status code.
Response Lenses
createPolicyResponse_policyName :: Lens' CreatePolicyResponse (Maybe Text) Source #
The policy name.
createPolicyResponse_policyDocument :: Lens' CreatePolicyResponse (Maybe Text) Source #
The JSON document that describes the policy.
createPolicyResponse_policyVersionId :: Lens' CreatePolicyResponse (Maybe Text) Source #
The policy version ID.
createPolicyResponse_policyArn :: Lens' CreatePolicyResponse (Maybe Text) Source #
The policy ARN.
createPolicyResponse_httpStatus :: Lens' CreatePolicyResponse Int Source #
The response's http status code.