AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
This is the response object from the CreatePolicy operation.
Namespace: Amazon.VerifiedPermissions.Model
Assembly: AWSSDK.VerifiedPermissions.dll
Version: 3.x.y.z
public class CreatePolicyResponse : AmazonWebServiceResponse
The CreatePolicyResponse type exposes the following members
| Name | Description | |
|---|---|---|
|
CreatePolicyResponse() |
| Name | Type | Description | |
|---|---|---|---|
|
Actions | System.Collections.Generic.List<Amazon.VerifiedPermissions.Model.ActionIdentifier> |
Gets and sets the property Actions.
The action that a policy permits or forbids. For example, |
|
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
|
CreatedDate | System.DateTime |
Gets and sets the property CreatedDate. The date and time the policy was originally created. |
|
Effect | Amazon.VerifiedPermissions.PolicyEffect |
Gets and sets the property Effect.
The effect of the decision that a policy returns to an authorization request. For
example, |
|
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
|
LastUpdatedDate | System.DateTime |
Gets and sets the property LastUpdatedDate. The date and time the policy was last updated. |
|
PolicyId | System.String |
Gets and sets the property PolicyId. The unique ID of the new policy. |
|
PolicyStoreId | System.String |
Gets and sets the property PolicyStoreId. The ID of the policy store that contains the new policy. |
|
PolicyType | Amazon.VerifiedPermissions.PolicyType |
Gets and sets the property PolicyType. The policy type of the new policy. |
|
Principal | Amazon.VerifiedPermissions.Model.EntityIdentifier |
Gets and sets the property Principal.
The principal specified in the new policy's scope. This response element isn't present
when |
|
Resource | Amazon.VerifiedPermissions.Model.EntityIdentifier |
Gets and sets the property Resource.
The resource specified in the new policy's scope. This response element isn't present
when the |
|
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
The following example request creates a static policy with a policy scope that specifies both a principal and a resource. The response includes both the Principal and Resource elements because both were specified in the request policy scope.
var client = new AmazonVerifiedPermissionsClient();
var response = client.BatchGetPolicy(new BatchGetPolicyRequest
{
Requests = new List<BatchGetPolicyInputItem> {
new BatchGetPolicyInputItem {
PolicyId = "PWv5M6d5HePx3gVVLKY1nK",
PolicyStoreId = "ERZeDpRc34dkYZeb6FZRVC"
},
new BatchGetPolicyInputItem {
PolicyId = "LzFn6KgLWvv4Mbegus35jn",
PolicyStoreId = "ERZeDpRc34dkYZeb6FZRVC"
},
new BatchGetPolicyInputItem {
PolicyId = "77gLjer8H5o3mvrnMGrSL5",
PolicyStoreId = "ERZeDpRc34dkYZeb6FZRVC"
}
}
});
List<BatchGetPolicyErrorItem> errors = response.Errors;
List<BatchGetPolicyOutputItem> results = response.Results;
The following example request creates a static policy with a policy scope that specifies both a principal and a resource. The response includes both the Principal and Resource elements because both were specified in the request policy scope.
var client = new AmazonVerifiedPermissionsClient();
var response = client.CreatePolicy(new CreatePolicyRequest
{
ClientToken = "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111",
Definition = new PolicyDefinition { Static = new StaticPolicyDefinition {
Description = "Grant members of janeFriends UserGroup access to the vacationFolder Album",
Statement = "permit( principal in UserGroup::\"janeFriends\", action, resource in Album::\"vacationFolder\" );"
} },
PolicyStoreId = "C7v5xMplfFH3i3e4Jrzb1a"
});
DateTime createdDate = response.CreatedDate;
DateTime lastUpdatedDate = response.LastUpdatedDate;
string policyId = response.PolicyId;
string policyStoreId = response.PolicyStoreId;
string policyType = response.PolicyType;
EntityIdentifier principal = response.Principal;
EntityIdentifier resource = response.Resource;
The following example creates a template-linked policy using the specified policy template and associates the specified principal to use with the new template-linked policy.
var client = new AmazonVerifiedPermissionsClient();
var response = client.CreatePolicy(new CreatePolicyRequest
{
ClientToken = "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111",
Definition = new PolicyDefinition { TemplateLinked = new TemplateLinkedPolicyDefinition {
PolicyTemplateId = "PTEXAMPLEabcdefg111111",
Principal = new EntityIdentifier {
EntityId = "alice",
EntityType = "User"
}
} },
PolicyStoreId = "C7v5xMplfFH3i3e4Jrzb1a"
});
DateTime createdDate = response.CreatedDate;
DateTime lastUpdatedDate = response.LastUpdatedDate;
string policyId = response.PolicyId;
string policyStoreId = response.PolicyStoreId;
string policyType = response.PolicyType;
EntityIdentifier principal = response.Principal;
EntityIdentifier resource = response.Resource;
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5