/// <summary> /// Create a new Assigned Item. /// </summary> /// <param name="pathTrustProductSid"> The unique string that identifies the resource. </param> /// <param name="objectSid"> The sid of an object bag </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of TrustProductsEntityAssignments </returns> public static async System.Threading.Tasks.Task <TrustProductsEntityAssignmentsResource> CreateAsync(string pathTrustProductSid, string objectSid, ITwilioRestClient client = null) { var options = new CreateTrustProductsEntityAssignmentsOptions(pathTrustProductSid, objectSid); return(await CreateAsync(options, client)); }
/// <summary> /// Create a new Assigned Item. /// </summary> /// <param name="pathTrustProductSid"> The unique string that identifies the resource. </param> /// <param name="objectSid"> The sid of an object bag </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of TrustProductsEntityAssignments </returns> public static TrustProductsEntityAssignmentsResource Create(string pathTrustProductSid, string objectSid, ITwilioRestClient client = null) { var options = new CreateTrustProductsEntityAssignmentsOptions(pathTrustProductSid, objectSid); return(Create(options, client)); }
/// <summary> /// Create a new Assigned Item. /// </summary> /// <param name="options"> Create TrustProductsEntityAssignments parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of TrustProductsEntityAssignments </returns> public static TrustProductsEntityAssignmentsResource Create(CreateTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Trusthub, "/v1/TrustProducts/" + options.PathTrustProductSid + "/EntityAssignments", postParams: options.GetParams(), headerParams: null )); }
/// <summary> /// Create a new Assigned Item. /// </summary> /// <param name="options"> Create TrustProductsEntityAssignments parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of TrustProductsEntityAssignments </returns> public static async System.Threading.Tasks.Task <TrustProductsEntityAssignmentsResource> CreateAsync(CreateTrustProductsEntityAssignmentsOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }