public void GetContextKeysForPrincipalPolicyMarshallTest() { var operation = service_model.FindOperation("GetContextKeysForPrincipalPolicy"); var request = InstantiateClassGenerator.Execute<GetContextKeysForPrincipalPolicyRequest>(); var marshaller = new GetContextKeysForPrincipalPolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation); validator.Validate(); var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute(); var context = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null); var response = GetContextKeysForPrincipalPolicyResponseUnmarshaller.Instance.Unmarshall(context) as GetContextKeysForPrincipalPolicyResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <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> /// 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="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> /// 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); }