public void CreateUserMarshallTest() { var operation = service_model.FindOperation("CreateUser"); var request = InstantiateClassGenerator.Execute <CreateUserRequest>(); var marshaller = new CreateUserRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateUser", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { { "x-amzn-RequestId", Guid.NewGuid().ToString() }, { "x-amz-crc32", "0" } } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString()); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = CreateUserResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateUserResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
internal virtual CreateUserResponse CreateUser(CreateUserRequest request) { var marshaller = new CreateUserRequestMarshaller(); var unmarshaller = CreateUserResponseUnmarshaller.Instance; return(Invoke <CreateUserRequest, CreateUserResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Initiates the asynchronous execution of the CreateUser operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateUser 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> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/CreateUser">REST API Reference for CreateUser Operation</seealso> public virtual Task <CreateUserResponse> CreateUserAsync(CreateUserRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateUserRequestMarshaller(); var unmarshaller = CreateUserResponseUnmarshaller.Instance; return(InvokeAsync <CreateUserRequest, CreateUserResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the CreateUser operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateUser 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<CreateUserResponse> CreateUserAsync(CreateUserRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateUserRequestMarshaller(); var unmarshaller = CreateUserResponseUnmarshaller.Instance; return InvokeAsync<CreateUserRequest,CreateUserResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal CreateUserResponse CreateUser(CreateUserRequest request) { var marshaller = new CreateUserRequestMarshaller(); var unmarshaller = CreateUserResponseUnmarshaller.Instance; return Invoke<CreateUserRequest,CreateUserResponse>(request, marshaller, unmarshaller); }
IAsyncResult invokeCreateUser(CreateUserRequest createUserRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateUserRequestMarshaller().Marshall(createUserRequest); var unmarshaller = CreateUserResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
public void CreateUserMarshallTest() { var operation = service_model.FindOperation("CreateUser"); var request = InstantiateClassGenerator.Execute<CreateUserRequest>(); var marshaller = new CreateUserRequestMarshaller(); 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 = CreateUserResponseUnmarshaller.Instance.Unmarshall(context) as CreateUserResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the CreateUser operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateUser 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 EndCreateUser /// operation.</returns> public IAsyncResult BeginCreateUser(CreateUserRequest request, AsyncCallback callback, object state) { var marshaller = new CreateUserRequestMarshaller(); var unmarshaller = CreateUserResponseUnmarshaller.Instance; return BeginInvoke<CreateUserRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para>Creates a new User for your AWS Account.</para> <para>For /// information about limitations on the number of Users you can create, /// see Limitations on IAM Entities in Using AWS Identity and Access /// Management.</para> /// </summary> /// /// <param name="createUserRequest">Container for the necessary parameters /// to execute the CreateUser service method on /// AmazonIdentityManagementService.</param> /// /// <returns>The response from the CreateUser service method, as returned /// by AmazonIdentityManagementService.</returns> /// /// <exception cref="NoSuchEntityException"/> /// <exception cref="LimitExceededException"/> /// <exception cref="EntityAlreadyExistsException"/> public CreateUserResponse CreateUser(CreateUserRequest createUserRequest) { IRequest<CreateUserRequest> request = new CreateUserRequestMarshaller().Marshall(createUserRequest); CreateUserResponse response = Invoke<CreateUserRequest, CreateUserResponse> (request, this.signer, CreateUserResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// Initiates the asynchronous execution of the CreateUser operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateUser 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 CreateUserAsync(CreateUserRequest request, AmazonServiceCallback<CreateUserRequest, CreateUserResponse> callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var marshaller = new CreateUserRequestMarshaller(); var unmarshaller = CreateUserResponseUnmarshaller.Instance; Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult<CreateUserRequest,CreateUserResponse> responseObject = new AmazonServiceResult<CreateUserRequest,CreateUserResponse>((CreateUserRequest)req, (CreateUserResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke<CreateUserRequest>(request, marshaller, unmarshaller, options, callbackHelper); }
/// <summary> /// Initiates the asynchronous execution of the CreateUser operation. /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService.CreateUser"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateUser 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 async Task<CreateUserResponse> CreateUserAsync(CreateUserRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateUserRequestMarshaller(); var unmarshaller = CreateUserResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateUserRequest, CreateUserResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para>Creates a new user for your AWS account.</para> <para>For information about limitations on the number of users you can create, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/index.html?LimitationsOnEntities.html">Limitations on IAM Entities</a> in <i>Using /// AWS Identity and Access Management</i> .</para> /// </summary> /// /// <param name="createUserRequest">Container for the necessary parameters to execute the CreateUser service method on /// AmazonIdentityManagementService.</param> /// /// <returns>The response from the CreateUser service method, as returned by AmazonIdentityManagementService.</returns> /// /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.LimitExceededException" /> /// <exception cref="T:Amazon.IdentityManagement.Model.EntityAlreadyExistsException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<CreateUserResponse> CreateUserAsync(CreateUserRequest createUserRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateUserRequestMarshaller(); var unmarshaller = CreateUserResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateUserRequest, CreateUserResponse>(createUserRequest, marshaller, unmarshaller, signer, cancellationToken); }
IAsyncResult invokeCreateUser(CreateUserRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new CreateUserRequestMarshaller(); var unmarshaller = CreateUserResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }