/// <summary> /// create /// </summary> /// <param name="options"> Create ExportCustomJob parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of ExportCustomJob </returns> public static ExportCustomJobResource Create(CreateExportCustomJobOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateExportCustomJobOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Preview, "/BulkExports/Exports/" + options.PathResourceType + "/Jobs", postParams: options.GetParams() )); }
/// <summary> /// create /// </summary> /// <param name="pathResourceType"> The type of communication – Messages or Calls, Conferences, and Participants /// </param> /// <param name="startDay"> The start day for the custom export specified as a string in the format of yyyy-mm-dd /// </param> /// <param name="endDay"> The end day for the custom export specified as a string in the format of yyyy-mm-dd. End day /// is inclusive and must be 2 days earlier than the current UTC day. </param> /// <param name="friendlyName"> The friendly name specified when creating the job </param> /// <param name="webhookUrl"> The optional webhook url called on completion of the job. If this is supplied, /// `WebhookMethod` must also be supplied. </param> /// <param name="webhookMethod"> This is the method used to call the webhook on completion of the job. If this is /// supplied, `WebhookUrl` must also be supplied. </param> /// <param name="email"> The optional email to send the completion notification to </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of ExportCustomJob </returns> public static async System.Threading.Tasks.Task <ExportCustomJobResource> CreateAsync(string pathResourceType, string startDay, string endDay, string friendlyName, string webhookUrl = null, string webhookMethod = null, string email = null, ITwilioRestClient client = null) { var options = new CreateExportCustomJobOptions(pathResourceType, startDay, endDay, friendlyName) { WebhookUrl = webhookUrl, WebhookMethod = webhookMethod, Email = email }; return(await CreateAsync(options, client)); }
/// <summary> /// create /// </summary> /// <param name="pathResourceType"> The type of communication – Messages or Calls, Conferences, and Participants /// </param> /// <param name="startDay"> The start day for the custom export specified as a string in the format of yyyy-mm-dd /// </param> /// <param name="endDay"> The end day for the custom export specified as a string in the format of yyyy-mm-dd. End day /// is inclusive and must be 2 days earlier than the current UTC day. </param> /// <param name="friendlyName"> The friendly name specified when creating the job </param> /// <param name="webhookUrl"> The optional webhook url called on completion of the job. If this is supplied, /// `WebhookMethod` must also be supplied. </param> /// <param name="webhookMethod"> This is the method used to call the webhook on completion of the job. If this is /// supplied, `WebhookUrl` must also be supplied. </param> /// <param name="email"> The optional email to send the completion notification to </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of ExportCustomJob </returns> public static ExportCustomJobResource Create(string pathResourceType, string startDay, string endDay, string friendlyName, string webhookUrl = null, string webhookMethod = null, string email = null, ITwilioRestClient client = null) { var options = new CreateExportCustomJobOptions(pathResourceType, startDay, endDay, friendlyName) { WebhookUrl = webhookUrl, WebhookMethod = webhookMethod, Email = email }; return(Create(options, client)); }
/// <summary> /// create /// </summary> /// <param name="options"> Create ExportCustomJob parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of ExportCustomJob </returns> public static async System.Threading.Tasks.Task <ExportCustomJobResource> CreateAsync(CreateExportCustomJobOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }