/// <summary> /// Create a new credential list mapping resource /// </summary> /// <param name="options"> Create AuthCallsCredentialListMapping parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AuthCallsCredentialListMapping </returns> public static AuthCallsCredentialListMappingResource Create(CreateAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateAuthCallsCredentialListMappingOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/SIP/Domains/" + options.PathDomainSid + "/Auth/Calls/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 AuthCallsCredentialListMapping </returns> public static async System.Threading.Tasks.Task <AuthCallsCredentialListMappingResource> CreateAsync(string pathDomainSid, string credentialListSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new CreateAuthCallsCredentialListMappingOptions(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 AuthCallsCredentialListMapping </returns> public static AuthCallsCredentialListMappingResource Create(string pathDomainSid, string credentialListSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new CreateAuthCallsCredentialListMappingOptions(pathDomainSid, credentialListSid) { PathAccountSid = pathAccountSid }; return(Create(options, client)); }
/// <summary> /// Create a new credential list mapping resource /// </summary> /// <param name="options"> Create AuthCallsCredentialListMapping parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AuthCallsCredentialListMapping </returns> public static async System.Threading.Tasks.Task <AuthCallsCredentialListMappingResource> CreateAsync(CreateAuthCallsCredentialListMappingOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }