/// <summary> /// create /// </summary> /// <param name="options"> Create ModelBuild parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of ModelBuild </returns> public static ModelBuildResource Create(CreateModelBuildOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateModelBuildOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Autopilot, "/v1/Assistants/" + options.PathAssistantSid + "/ModelBuilds", postParams: options.GetParams() )); }
/// <summary> /// create /// </summary> /// <param name="pathAssistantSid"> The SID of the Assistant that is the parent of the new resource </param> /// <param name="statusCallback"> The URL we should call using a POST method to send status information to your /// application </param> /// <param name="uniqueName"> An application-defined string that uniquely identifies the new resource </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of ModelBuild </returns> public static async System.Threading.Tasks.Task <ModelBuildResource> CreateAsync(string pathAssistantSid, Uri statusCallback = null, string uniqueName = null, ITwilioRestClient client = null) { var options = new CreateModelBuildOptions(pathAssistantSid) { StatusCallback = statusCallback, UniqueName = uniqueName }; return(await CreateAsync(options, client)); }
/// <summary> /// create /// </summary> /// <param name="pathAssistantSid"> The SID of the Assistant that is the parent of the new resource </param> /// <param name="statusCallback"> The URL we should call using a POST method to send status information to your /// application </param> /// <param name="uniqueName"> An application-defined string that uniquely identifies the new resource </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of ModelBuild </returns> public static ModelBuildResource Create(string pathAssistantSid, Uri statusCallback = null, string uniqueName = null, ITwilioRestClient client = null) { var options = new CreateModelBuildOptions(pathAssistantSid) { StatusCallback = statusCallback, UniqueName = uniqueName }; return(Create(options, client)); }
/// <summary> /// create /// </summary> /// <param name="options"> Create ModelBuild parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of ModelBuild </returns> public static async System.Threading.Tasks.Task <ModelBuildResource> CreateAsync(CreateModelBuildOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }