/// <summary> /// Create a new credential list mapping resource /// </summary> /// <param name="options"> Create AuthRegistrationsCredentialListMapping parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AuthRegistrationsCredentialListMapping </returns> public static AuthRegistrationsCredentialListMappingResource Create(CreateAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/SIP/Domains/" + options.PathDomainSid + "/Auth/Registrations/CredentialListMappings.json", postParams: options.GetParams() )); }
/// <summary> /// Create a new credential list mapping resource /// </summary> /// <param name="pathDomainSid"> The SID of the SIP domain that will contain the new resource </param> /// <param name="credentialListSid"> The SID of the CredentialList resource to map to the SIP domain </param> /// <param name="pathAccountSid"> The SID of the Account that will create the resource </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AuthRegistrationsCredentialListMapping </returns> public static async System.Threading.Tasks.Task <AuthRegistrationsCredentialListMappingResource> CreateAsync(string pathDomainSid, string credentialListSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new CreateAuthRegistrationsCredentialListMappingOptions(pathDomainSid, credentialListSid) { PathAccountSid = pathAccountSid }; return(await CreateAsync(options, client)); }
/// <summary> /// Create a new credential list mapping resource /// </summary> /// <param name="pathDomainSid"> The SID of the SIP domain that will contain the new resource </param> /// <param name="credentialListSid"> The SID of the CredentialList resource to map to the SIP domain </param> /// <param name="pathAccountSid"> The SID of the Account that will create the resource </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AuthRegistrationsCredentialListMapping </returns> public static AuthRegistrationsCredentialListMappingResource Create(string pathDomainSid, string credentialListSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new CreateAuthRegistrationsCredentialListMappingOptions(pathDomainSid, credentialListSid) { PathAccountSid = pathAccountSid }; return(Create(options, client)); }
/// <summary> /// Create a new credential list mapping resource /// </summary> /// <param name="options"> Create AuthRegistrationsCredentialListMapping parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AuthRegistrationsCredentialListMapping </returns> public static async System.Threading.Tasks.Task <AuthRegistrationsCredentialListMappingResource> CreateAsync(CreateAuthRegistrationsCredentialListMappingOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }