/// <summary> /// Create a new enrollment Access Token for the Entity /// </summary> /// <param name="options"> Create AccessToken parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AccessToken </returns> public static AccessTokenResource Create(CreateAccessTokenOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Create a new enrollment Access Token for the Entity /// </summary> /// <param name="pathServiceSid"> The service_sid </param> /// <param name="identity"> Unique external identifier of the Entity </param> /// <param name="factorType"> The Type of this Factor </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AccessToken </returns> public static AccessTokenResource Create(string pathServiceSid, string identity, AccessTokenResource.FactorTypesEnum factorType, ITwilioRestClient client = null) { var options = new CreateAccessTokenOptions(pathServiceSid, identity, factorType); return(Create(options, client)); }
private static Request BuildCreateRequest(CreateAccessTokenOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Verify, "/v2/Services/" + options.PathServiceSid + "/AccessTokens", postParams: options.GetParams() )); }
/// <summary> /// Create a new enrollment Access Token for the Entity /// </summary> /// <param name="pathServiceSid"> The service_sid </param> /// <param name="identity"> Unique external identifier of the Entity </param> /// <param name="factorType"> The Type of this Factor </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AccessToken </returns> public static async System.Threading.Tasks.Task <AccessTokenResource> CreateAsync(string pathServiceSid, string identity, AccessTokenResource.FactorTypesEnum factorType, ITwilioRestClient client = null) { var options = new CreateAccessTokenOptions(pathServiceSid, identity, factorType); return(await CreateAsync(options, client)); }
/// <summary> /// Create a new enrollment Access Token for the Entity /// </summary> /// <param name="options"> Create AccessToken parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AccessToken </returns> public static async System.Threading.Tasks.Task <AccessTokenResource> CreateAsync(CreateAccessTokenOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }