func CreateAccessRule(account string, ip string, note string) bool {
	ipa := net.ParseIP(ip)
	target := "ip6"
	if ipa.To4() != nil {
		target = "ip"
	}

	config := AccessRuleConfig{
		Target: target,
		Value:  ip,
	}

	accessRule := &AccessRuleRequest{
		Mode:          "whitelist",
		Configuration: config,
		Notes:         note,
	}

	data, err := json.Marshal(accessRule)
	if err != nil {
		log.Println(err)
	}

	req, err := http.NewRequest("POST", url+"accounts/"+account+"/firewall/access_rules/rules", bytes.NewBuffer(data))
	if err != nil {
		log.Println(err)
	}
	req.Header.Add("Authorization", "Bearer "+token)
	req.Header.Add("Accept", "application/json")
	req.Header.Add("Content-Type", "application/json")

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		log.Println(err)
	}

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Println(err)
	}

	var ar = &AccessRuleResponse{}
	err = json.Unmarshal(body, &ar)

	return ar.Success
}
// CreateAccessRule Make a new IP, IP range, or country access rule for all
// zones owned by the account.
// POST accounts/:account_identifier/firewall/access_rules/rules
CreateAccessRule Make a new IP, IP range, or country access rule for all
zones owned by the account.
POST accounts/:account_identifier/firewall/access_rules/rules
// CreateAccessRule Make a new IP IP range or country access rule for all // zones owned by the account . // POST accounts / : account_identifier / firewall / access_rules / rules
func CreateAccessRule(account string, ip string, note string) bool {
	ipa := net.ParseIP(ip)
	target := "ip6"
	if ipa.To4() != nil {
		target = "ip"
	}
	config := AccessRuleConfig{
		Target: target,
		Value:  ip,
	}
	accessRule := &AccessRuleRequest{
		Mode:          "whitelist",
		Configuration: config,
		Notes:         note,
	}
	data, err := json.Marshal(accessRule)
	if err != nil {
		log.Println(err)
	}
	req, err := http.NewRequest("POST", url+"accounts/"+account+"/firewall/access_rules/rules", bytes.NewBuffer(data))
	if err != nil {
		log.Println(err)
	}
	req.Header.Add("Authorization", "Bearer "+token)
	req.Header.Add("Accept", "application/json")
	req.Header.Add("Content-Type", "application/json")
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		log.Println(err)
	}
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Println(err)
	}
	var ar = &AccessRuleResponse{}
	err = json.Unmarshal(body, &ar)
	return ar.Success
}
func CreateAccessRule ( account string , ip string , note string ) bool { ipa := net . ParseIP ( ip ) target := " " if ipa . To4 ( ) != nil { target = " " } config := AccessRuleConfig { Target : target , Value : ip , } accessRule := & AccessRuleRequest { Mode : " " , Configuration : config , Notes : note , } data , err := json . Marshal ( accessRule ) if err != nil { log . Println ( err ) } req , err := http . NewRequest ( " " , url + " " + account + " " , bytes . NewBuffer ( data ) ) if err != nil { log . Println ( err ) } req . Header . Add ( " " , " " + token ) req . Header . Add ( " " , " " ) req . Header . Add ( " " , " " ) client := & http . Client { } resp , err := client . Do ( req ) if err != nil { log . Println ( err ) } body , err := ioutil . ReadAll ( resp . Body ) if err != nil { log . Println ( err ) } var ar = & AccessRuleResponse { } err = json . Unmarshal ( body , & ar ) return ar . Success }
CreateAccessRule Make a new IP, IP range, or country access rule for all
zones owned by the account.
CreateAccessRule Make a new IP IP range or country access rule for all zones owned by the account .