Amazon.IoT.AmazonIoTClient.CreatePolicyAsync C# (CSharp) Метод

CreatePolicyAsync() публичный Метод

Creates an AWS 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.

/// An unexpected error has occurred. /// /// The request is not valid. /// /// The policy documentation is not valid. /// /// The resource already exists. /// /// The service is temporarily unavailable. /// /// The rate exceeds the limit. /// /// You are not authorized to perform this operation. ///
public CreatePolicyAsync ( string policyName, string policyDocument, System cancellationToken = default(CancellationToken) ) : Task
policyName string The policy name.
policyDocument string The JSON document that describes the policy. policyDocument must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
Результат Task
        public Task<CreatePolicyResponse> CreatePolicyAsync(string policyName, string policyDocument, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var request = new CreatePolicyRequest();
            request.PolicyName = policyName;
            request.PolicyDocument = policyDocument;
            return CreatePolicyAsync(request, cancellationToken);
        }

Same methods

AmazonIoTClient::CreatePolicyAsync ( CreatePolicyRequest request, System cancellationToken = default(CancellationToken) ) : Task
AmazonIoTClient