/// <summary> /// Provision the supplied structure. /// </summary> /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">ID of the customer to provision</param> /// <param name="structureProvision">Structure of the Customer (trust). This call should be considered a 'set' - elements omitted that were present in previous provisionings should be removed.</param> /// <returns>Task of ApiResponse</returns> public async System.Threading.Tasks.Task <ASW.APIServices.VMS.Client.ApiResponse <Object> > ProvisionStructureAsyncWithHttpInfo(string id, StructureProvision structureProvision) { // 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->ProvisionStructure"); } // verify the required parameter 'structureProvision' is set if (structureProvision == null) { throw new ASW.APIServices.VMS.Client.ApiException(400, "Missing required parameter 'structureProvision' when calling ProvisioningApi->ProvisionStructure"); } 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 = structureProvision; // make the HTTP request var localVarResponse = await this.AsynchronousClient.PutAsync <Object>("/provision/customer/{id}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("ProvisionStructure", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Provision the supplied structure. /// </summary> /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">ID of the customer to provision</param> /// <param name="structureProvision">Structure of the Customer (trust). This call should be considered a 'set' - elements omitted that were present in previous provisionings should be removed.</param> /// <returns>Task of void</returns> public async System.Threading.Tasks.Task ProvisionStructureAsync(string id, StructureProvision structureProvision) { await ProvisionStructureAsyncWithHttpInfo(id, structureProvision); }
public virtual IActionResult ProvisionStructure([FromRoute][Required] string id, [FromBody] StructureProvision structureProvision) { //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); throw new NotImplementedException(); }
/// <summary> /// Provision the supplied structure. /// </summary> /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">ID of the customer to provision</param> /// <param name="structureProvision">Structure of the Customer (trust). This call should be considered a 'set' - elements omitted that were present in previous provisionings should be removed.</param> /// <returns></returns> public void ProvisionStructure(string id, StructureProvision structureProvision) { ProvisionStructureWithHttpInfo(id, structureProvision); }
/// <summary> /// Provision the supplied structure. /// </summary> /// <exception cref="ASW.APIServices.VMS.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">ID of the customer to provision</param> /// <param name="structureProvision">Structure of the Customer (trust). This call should be considered a 'set' - elements omitted that were present in previous provisionings should be removed.</param> /// <returns>Task of ApiResponse</returns> public async System.Threading.Tasks.Task <ApiResponse <Object> > ProvisionStructureAsyncWithHttpInfo(string id, StructureProvision structureProvision) { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing required parameter 'id' when calling ProvisioningApi->ProvisionStructure"); } // verify the required parameter 'structureProvision' is set if (structureProvision == null) { throw new ApiException(400, "Missing required parameter 'structureProvision' when calling ProvisioningApi->ProvisionStructure"); } var localVarPath = "/provision/customer/{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 (structureProvision != null && structureProvision.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(structureProvision); // http body (model) parameter } else { localVarPostBody = structureProvision; // 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("ProvisionStructure", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <Object>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), null)); }