示例#1
0
// DeleteCredentialMapping deletes a credential with the given sid from this domain
// https://www.twilio.com/docs/api/rest/domain#list-delete-clm
func (act Account) DeleteCredentialMapping(domainSid, credentialSid string) error {
	if !validateCredentialListSid(credentialSid) {
		return errors.New("Invalid credential sid")
	} else if !validateDomainSid(domainSid) {
		return errors.New("Invalid domain sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(domainCredentialList.Get, act.AccountSid, domainSid, credentialSid), act)
}
示例#2
0
// DeleteCredential allows you to delete a credential from your account
// https://www.twilio.com/docs/api/rest/credential-list#instance-delete-credential
func (act Account) DeleteCredential(clSid, credSid string) error {
	if !validateMappingSid(clSid) {
		return errors.New("Invalid credential list sid")
	} else if !validateCredentialSid(credSid) {
		return errors.New("Invalid credential sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(credential.Get, act.AccountSid, clSid, credSid), act)
}
// DeleteIPAddress allows you to delete an ip address from your account
// https://www.twilio.com/docs/api/rest/ip-access-control-list#instance-delete-ipaddress
func (act Account) DeleteIPAddress(alSid, ipSid string) error {
	if !validateMappingSid(alSid) {
		return errors.New("Invalid ip access control sid")
	} else if !validateIPSid(ipSid) {
		return errors.New("Invalid ip sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(ipAddress.Get, act.AccountSid, alSid, ipSid), act)
}
示例#4
0
// Kick a participant with callSid from conference with confSid.
func (act Account) Kick(confSid string, callSid string) error {
	if !validateConferenceSid(confSid) {
		return errors.New("Invalid conference sid")
	} else if !validateCallSid(callSid) {
		return errors.New("Invalid call sid for participant")
	}
	return common.SendDeleteRequest(fmt.Sprintf(participant.Get, act.AccountSid, confSid, callSid), act)
}
示例#5
0
// DeleteMapping a mapping with the given sid from this domain
// https://www.twilio.com/docs/api/rest/domain#subresource-list-delete-ipacl
func (act Account) DeleteMapping(domainSid, mappingSid string) error {
	if !validateMappingSid(mappingSid) {
		return errors.New("Invalid control sid")
	}
	if !validateDomainSid(domainSid) {
		return errors.New("Invalid domain sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(domainControlList.Get, act.AccountSid, domainSid, mappingSid), act)
}
示例#6
0
// Delete removes a recording from Twilio servers.
func (act Account) Delete(recSid string) error {
	if !validateRecordingSid(recSid) {
		return errors.New("Invalid sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(recordings.Get, act.AccountSid, recSid), act)
}
// DeleteControlList allows you to delete an IPAccessControlList from your account
// https://www.twilio.com/docs/api/rest/ip-access-control-list#instance-delete
func (act Account) DeleteControlList(alSid string) error {
	if !validateMappingSid(alSid) {
		return errors.New("Invalid ip access control sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(ipAccessControlList.Get, act.AccountSid, alSid), act)
}
示例#8
0
// Delete a number from your account
//
// https://www.twilio.com/docs/api/rest/incoming-phone-numbers#instance-delete
func (act Account) Delete(numberSid string) error {
	if !validateNumberSid(numberSid) {
		return errors.New("Invalid sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(numbers.Get, act.AccountSid, numberSid), act)
}
示例#9
0
// DeleteDomain a sip domain with the given SIP sid
// https://www.twilio.com/docs/api/rest/domain#instance-delete
func (act Account) DeleteDomain(domainSid string) error {
	if !validateDomainSid(domainSid) {
		return errors.New("Invalid SIP sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(domain.Get, act.AccountSid, domainSid), act)
}
示例#10
0
// Delete removes a Twilio error notification based off of the sid.
func (act Account) Delete(sid string) error {
	if !validateNotificationSid(sid) {
		return errors.New("Invalid sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(notifications.Get, act.AccountSid, sid), act)
}
示例#11
0
// Delete a queue from your account
// http://www.twilio.com/docs/api/rest/queue#instance-delete
func (act Account) Delete(queueSid string) error {
	if !validateQueueSid(queueSid) {
		return errors.New("Invalid queue sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(queue.Get, act.AccountSid, queueSid), act)
}
示例#12
0
// DeleteTrigger removes a Twilio trigger.
func (act Account) DeleteTrigger(sid string) error {
	if !validateTriggerSid(sid) {
		return errors.New("Invalid sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(usage.Delete, act.AccountSid, sid), act)
}
示例#13
0
// Delete removes a transcription resource from Twilio's server.
// Can get .mp3 or .wav of recording from the uri provided in Recording
func (act Account) Delete(trSid string) error {
	if !validateTranscriptionSid(trSid) {
		return errors.New("Invalid sid")
	}
	return common.SendDeleteRequest(fmt.Sprintf(transcriptions.Get, act.AccountSid, string(trSid)), act)
}