public virtual IActionResult ProvisionUser([FromRoute][Required] string id, [FromBody] UserProvision userProvision) { //TODO: Uncomment the next line to return response 204 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(204); //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); //TODO: Uncomment the next line to return response 401 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(401); //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); throw new NotImplementedException(); }
/// <summary> /// Provision the supplied user. /// </summary> /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">ID of the user to provision</param> /// <param name="userProvision">Structure of the User</param> /// <returns>Task of ApiResponse</returns> public async System.Threading.Tasks.Task <ASW.APIServices.VMS.Client.ApiResponse <Object> > ProvisionUserAsyncWithHttpInfo(string id, UserProvision userProvision) { // verify the required parameter 'id' is set if (id == null) { throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'id' when calling ProvisioningApi->ProvisionUser"); } // verify the required parameter 'userProvision' is set if (userProvision == null) { throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'userProvision' when calling ProvisioningApi->ProvisionUser"); } ASW.APIServices.VMS.Client.RequestOptions localVarRequestOptions = new ASW.APIServices.VMS.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json" }; // to determine the Accept header String[] _accepts = new String[] { }; foreach (var _contentType in _contentTypes) { localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); } foreach (var _accept in _accepts) { localVarRequestOptions.HeaderParameters.Add("Accept", _accept); } if (id != null) { localVarRequestOptions.PathParameters.Add("id", ASW.APIServices.VMS.Client.ClientUtils.ParameterToString(id)); // path parameter } localVarRequestOptions.Data = userProvision; // make the HTTP request var localVarResponse = await this.AsynchronousClient.PutAsync <Object>("/provision/user/{id}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ProvisionUser", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Provision the supplied user. /// </summary> /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">ID of the user to provision</param> /// <param name="userProvision">Structure of the User</param> /// <returns>Task of void</returns> public async System.Threading.Tasks.Task ProvisionUserAsync(string id, UserProvision userProvision) { await ProvisionUserAsyncWithHttpInfo(id, userProvision); }
/// <summary> /// Provision the supplied user. /// </summary> /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">ID of the user to provision</param> /// <param name="userProvision">Structure of the User</param> /// <returns></returns> public void ProvisionUser(string id, UserProvision userProvision) { ProvisionUserWithHttpInfo(id, userProvision); }
/// <summary> /// Provision the supplied user. /// </summary> /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">ID of the user to provision</param> /// <param name="userProvision">Structure of the User</param> /// <returns>Task of ApiResponse</returns> public async System.Threading.Tasks.Task <ApiResponse <Object> > ProvisionUserAsyncWithHttpInfo(string id, UserProvision userProvision) { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing required parameter 'id' when calling ProvisioningApi->ProvisionUser"); } // verify the required parameter 'userProvision' is set if (userProvision == null) { throw new ApiException(400, "Missing required parameter 'userProvision' when calling ProvisioningApi->ProvisionUser"); } var localVarPath = "/provision/user/{id}"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <KeyValuePair <String, String> >(); var localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary <String, String>(); var localVarFileParams = new Dictionary <String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (id != null) { localVarPathParams.Add("id", this.Configuration.ApiClient.ParameterToString(id)); // path parameter } if (userProvision != null && userProvision.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(userProvision); // http body (model) parameter } else { localVarPostBody = userProvision; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("ProvisionUser", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <Object>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null)); }