Container for the parameters to the GetContextKeysForPrincipalPolicy operation. Gets a list of all of the context keys referenced in all of the IAM policies attached to the specified IAM entity. The entity can be an IAM user, group, or role. If you specify a user, then the request also includes all of the policies attached to groups that the user is a member of.

You can optionally include a list of one or more additional policies, specified as strings. If you want to include only a list of policies by string, use GetContextKeysForCustomPolicy instead.

Note: This API discloses information about the permissions granted to other users. If you do not want users to see other user's permissions, then consider allowing them to use GetContextKeysForCustomPolicy instead.

Context keys are variables maintained by AWS and its services that provide details about the context of an API query request, and can be evaluated by testing against a value in an IAM policy. Use GetContextKeysForPrincipalPolicy to understand what key names and values you must supply when you call SimulatePrincipalPolicy.

Inheritance: AmazonIdentityManagementServiceRequest
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.IdentityManagement.Model.GetContextKeysForPrincipalPolicyRequest();

            if (cmdletContext.PolicyInputList != null)
            {
                request.PolicyInputList = cmdletContext.PolicyInputList;
            }
            if (cmdletContext.PolicySourceArn != null)
            {
                request.PolicySourceArn = cmdletContext.PolicySourceArn;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the GetContextKeysForPrincipalPolicy operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetContextKeysForPrincipalPolicy operation on AmazonIdentityManagementServiceClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetContextKeysForPrincipalPolicy
        ///         operation.</returns>
        public IAsyncResult BeginGetContextKeysForPrincipalPolicy(GetContextKeysForPrincipalPolicyRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new GetContextKeysForPrincipalPolicyRequestMarshaller();
            var unmarshaller = GetContextKeysForPrincipalPolicyResponseUnmarshaller.Instance;

            return BeginInvoke<GetContextKeysForPrincipalPolicyRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Gets a list of all of the context keys referenced in <code>Condition</code> elements
        /// in all of the IAM policies attached to the specified IAM entity. The entity can be
        /// an IAM user, group, or role. If you specify a user, then the request also includes
        /// all of the policies attached to groups that the user is a member of.
        /// 
        ///  
        /// <para>
        /// You can optionally include a list of one or more additional policies, specified as
        /// strings. If you want to include only a list of policies by string, use <a>GetContextKeysForCustomPolicy</a>
        /// instead.
        /// </para>
        ///  
        /// <para>
        /// <b>Note:</b> This API discloses information about the permissions granted to other
        /// users. If you do not want users to see other user's permissions, then consider allowing
        /// them to use <a>GetContextKeysForCustomPolicy</a> instead.
        /// </para>
        ///  
        /// <para>
        /// Context keys are variables maintained by AWS and its services that provide details
        /// about the context of an API query request, and can be evaluated by using the <code>Condition</code>
        /// element of an IAM policy. Use GetContextKeysForPrincipalPolicy to understand what
        /// key names and values you must supply when you call <a>SimulatePrincipalPolicy</a>.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the GetContextKeysForPrincipalPolicy service method.</param>
        /// 
        /// <returns>The response from the GetContextKeysForPrincipalPolicy service method, as returned by IdentityManagementService.</returns>
        /// <exception cref="Amazon.IdentityManagement.Model.InvalidInputException">
        /// The request was rejected because an invalid or out-of-range value was supplied for
        /// an input parameter.
        /// </exception>
        /// <exception cref="Amazon.IdentityManagement.Model.NoSuchEntityException">
        /// The request was rejected because it referenced an entity that does not exist. The
        /// error message describes the entity.
        /// </exception>
        public GetContextKeysForPrincipalPolicyResponse GetContextKeysForPrincipalPolicy(GetContextKeysForPrincipalPolicyRequest request)
        {
            var marshaller = new GetContextKeysForPrincipalPolicyRequestMarshaller();
            var unmarshaller = GetContextKeysForPrincipalPolicyResponseUnmarshaller.Instance;

            return Invoke<GetContextKeysForPrincipalPolicyRequest,GetContextKeysForPrincipalPolicyResponse>(request, marshaller, unmarshaller);
        }
 /// <summary>
 /// Gets a list of all of the context keys referenced in <code>Condition</code> elements
 /// in all of the IAM policies attached to the specified IAM entity. The entity can be
 /// an IAM user, group, or role. If you specify a user, then the request also includes
 /// all of the policies attached to groups that the user is a member of.
 /// 
 ///  
 /// <para>
 /// You can optionally include a list of one or more additional policies, specified as
 /// strings. If you want to include only a list of policies by string, use <a>GetContextKeysForCustomPolicy</a>
 /// instead.
 /// </para>
 ///  
 /// <para>
 /// <b>Note:</b> This API discloses information about the permissions granted to other
 /// users. If you do not want users to see other user's permissions, then consider allowing
 /// them to use <a>GetContextKeysForCustomPolicy</a> instead.
 /// </para>
 ///  
 /// <para>
 /// Context keys are variables maintained by AWS and its services that provide details
 /// about the context of an API query request, and can be evaluated by using the <code>Condition</code>
 /// element of an IAM policy. Use GetContextKeysForPrincipalPolicy to understand what
 /// key names and values you must supply when you call <a>SimulatePrincipalPolicy</a>.
 /// </para>
 /// </summary>
 /// <param name="policySourceArn">The ARN of a user, group, or role whose policies contain the context keys that you want listed. If you specify a user, the list includes context keys that are found in all policies attached to the user as well as to all groups that the user is a member of. If you pick a group or a role, then it includes only those context keys that are found in policies attached to that entity. Note that all parameters are shown in unencoded form here for clarity, but must be URL encoded to be included as a part of a real HTML request.</param>
 /// <param name="policyInputList">A optional list of additional policies for which you want list of context keys used in <code>Condition</code> elements.</param>
 /// 
 /// <returns>The response from the GetContextKeysForPrincipalPolicy service method, as returned by IdentityManagementService.</returns>
 /// <exception cref="Amazon.IdentityManagement.Model.InvalidInputException">
 /// The request was rejected because an invalid or out-of-range value was supplied for
 /// an input parameter.
 /// </exception>
 /// <exception cref="Amazon.IdentityManagement.Model.NoSuchEntityException">
 /// The request was rejected because it referenced an entity that does not exist. The
 /// error message describes the entity.
 /// </exception>
 public GetContextKeysForPrincipalPolicyResponse GetContextKeysForPrincipalPolicy(string policySourceArn, List<string> policyInputList)
 {
     var request = new GetContextKeysForPrincipalPolicyRequest();
     request.PolicySourceArn = policySourceArn;
     request.PolicyInputList = policyInputList;
     return GetContextKeysForPrincipalPolicy(request);
 }
 private Amazon.IdentityManagement.Model.GetContextKeysForPrincipalPolicyResponse CallAWSServiceOperation(IAmazonIdentityManagementService client, Amazon.IdentityManagement.Model.GetContextKeysForPrincipalPolicyRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Identity and Access Management", "GetContextKeysForPrincipalPolicy");
     try
     {
         #if DESKTOP
         return(client.GetContextKeysForPrincipalPolicy(request));
         #elif CORECLR
         return(client.GetContextKeysForPrincipalPolicyAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
        /// <summary>
        /// Initiates the asynchronous execution of the GetContextKeysForPrincipalPolicy operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetContextKeysForPrincipalPolicy operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<GetContextKeysForPrincipalPolicyResponse> GetContextKeysForPrincipalPolicyAsync(GetContextKeysForPrincipalPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetContextKeysForPrincipalPolicyRequestMarshaller();
            var unmarshaller = GetContextKeysForPrincipalPolicyResponseUnmarshaller.Instance;

            return InvokeAsync<GetContextKeysForPrincipalPolicyRequest,GetContextKeysForPrincipalPolicyResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
 /// <summary>
 /// Gets a list of all of the context keys referenced in <code>Condition</code> elements
 /// in all of the IAM policies attached to the specified IAM entity. The entity can be
 /// an IAM user, group, or role. If you specify a user, then the request also includes
 /// all of the policies attached to groups that the user is a member of.
 /// 
 ///  
 /// <para>
 /// You can optionally include a list of one or more additional policies, specified as
 /// strings. If you want to include only a list of policies by string, use <a>GetContextKeysForCustomPolicy</a>
 /// instead.
 /// </para>
 ///  
 /// <para>
 /// <b>Note:</b> This API discloses information about the permissions granted to other
 /// users. If you do not want users to see other user's permissions, then consider allowing
 /// them to use <a>GetContextKeysForCustomPolicy</a> instead.
 /// </para>
 ///  
 /// <para>
 /// Context keys are variables maintained by AWS and its services that provide details
 /// about the context of an API query request, and can be evaluated by using the <code>Condition</code>
 /// element of an IAM policy. Use GetContextKeysForPrincipalPolicy to understand what
 /// key names and values you must supply when you call <a>SimulatePrincipalPolicy</a>.
 /// </para>
 /// </summary>
 /// <param name="policySourceArn">The ARN of a user, group, or role whose policies contain the context keys that you want listed. If you specify a user, the list includes context keys that are found in all policies attached to the user as well as to all groups that the user is a member of. If you pick a group or a role, then it includes only those context keys that are found in policies attached to that entity. Note that all parameters are shown in unencoded form here for clarity, but must be URL encoded to be included as a part of a real HTML request.</param>
 /// <param name="policyInputList">A optional list of additional policies for which you want list of context keys used in <code>Condition</code> elements.</param>
 /// <param name="cancellationToken">
 ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// 
 /// <returns>The response from the GetContextKeysForPrincipalPolicy service method, as returned by IdentityManagementService.</returns>
 /// <exception cref="Amazon.IdentityManagement.Model.InvalidInputException">
 /// The request was rejected because an invalid or out-of-range value was supplied for
 /// an input parameter.
 /// </exception>
 /// <exception cref="Amazon.IdentityManagement.Model.NoSuchEntityException">
 /// The request was rejected because it referenced an entity that does not exist. The
 /// error message describes the entity.
 /// </exception>
 public Task<GetContextKeysForPrincipalPolicyResponse> GetContextKeysForPrincipalPolicyAsync(string policySourceArn, List<string> policyInputList, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new GetContextKeysForPrincipalPolicyRequest();
     request.PolicySourceArn = policySourceArn;
     request.PolicyInputList = policyInputList;
     return GetContextKeysForPrincipalPolicyAsync(request, cancellationToken);
 }
 /// <summary>
 /// Initiates the asynchronous execution of the GetContextKeysForPrincipalPolicy operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the GetContextKeysForPrincipalPolicy operation on AmazonIdentityManagementServiceClient.</param>
 /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
 /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///          procedure using the AsyncState property.</param>
 public void GetContextKeysForPrincipalPolicyAsync(GetContextKeysForPrincipalPolicyRequest request, AmazonServiceCallback<GetContextKeysForPrincipalPolicyRequest, GetContextKeysForPrincipalPolicyResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new GetContextKeysForPrincipalPolicyRequestMarshaller();
     var unmarshaller = GetContextKeysForPrincipalPolicyResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<GetContextKeysForPrincipalPolicyRequest,GetContextKeysForPrincipalPolicyResponse> responseObject 
                     = new AmazonServiceResult<GetContextKeysForPrincipalPolicyRequest,GetContextKeysForPrincipalPolicyResponse>((GetContextKeysForPrincipalPolicyRequest)req, (GetContextKeysForPrincipalPolicyResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<GetContextKeysForPrincipalPolicyRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
 /// <summary>
 /// Gets a list of all of the context keys referenced in all of the IAM policies attached
 /// to the specified IAM entity. The entity can be an IAM user, group, or role. If you
 /// specify a user, then the request also includes all of the policies attached to groups
 /// that the user is a member of.
 /// 
 ///  
 /// <para>
 /// You can optionally include a list of one or more additional policies, specified as
 /// strings. If you want to include <i>only</i> a list of policies by string, use <a>GetContextKeysForCustomPolicy</a>
 /// instead.
 /// </para>
 ///  
 /// <para>
 ///  <b>Note:</b> This API discloses information about the permissions granted to other
 /// users. If you do not want users to see other user's permissions, then consider allowing
 /// them to use <a>GetContextKeysForCustomPolicy</a> instead.
 /// </para>
 ///  
 /// <para>
 /// Context keys are variables maintained by AWS and its services that provide details
 /// about the context of an API query request, and can be evaluated by testing against
 /// a value in an IAM policy. Use <a>GetContextKeysForPrincipalPolicy</a> to understand
 /// what key names and values you must supply when you call <a>SimulatePrincipalPolicy</a>.
 /// </para>
 /// </summary>
 /// <param name="policySourceArn">The ARN of a user, group, or role whose policies contain the context keys that you want listed. If you specify a user, the list includes context keys that are found in all policies attached to the user as well as to all groups that the user is a member of. If you pick a group or a role, then it includes only those context keys that are found in policies attached to that entity. Note that all parameters are shown in unencoded form here for clarity, but must be URL encoded to be included as a part of a real HTML request. For more information about ARNs, see <a href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</param>
 /// <param name="policyInputList">An optional list of additional policies for which you want the list of context keys that are referenced. This parameter allows (per its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of any printable ASCII character ranging from the space character (\u0020) through end of the ASCII character range (\u00FF). It also includes the special characters tab (\u0009), line feed (\u000A), and carriage return (\u000D).</param>
 /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
 /// <param name="options">
 ///     A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///     procedure using the AsyncState property.
 /// </param>
 /// 
 /// <returns>The response from the GetContextKeysForPrincipalPolicy service method, as returned by IdentityManagementService.</returns>
 /// <exception cref="Amazon.IdentityManagement.Model.InvalidInputException">
 /// The request was rejected because an invalid or out-of-range value was supplied for
 /// an input parameter.
 /// </exception>
 /// <exception cref="Amazon.IdentityManagement.Model.NoSuchEntityException">
 /// The request was rejected because it referenced an entity that does not exist. The
 /// error message describes the entity.
 /// </exception>
 public void GetContextKeysForPrincipalPolicyAsync(string policySourceArn, List<string> policyInputList,  AmazonServiceCallback<GetContextKeysForPrincipalPolicyRequest, GetContextKeysForPrincipalPolicyResponse> callback, AsyncOptions options = null)
 {
     var request = new GetContextKeysForPrincipalPolicyRequest();
     request.PolicySourceArn = policySourceArn;
     request.PolicyInputList = policyInputList;
     GetContextKeysForPrincipalPolicyAsync(request, callback, options);
 }