class CloudflareClient::Zone::CustomPage

Public Instance Methods

list() click to toggle source

Custom pages for a zone

custom_pages list all avaialble custom_pages

# File lib/cloudflare_client/zone/custom_page.rb, line 6
def list
  cf_get(path: "/zones/#{zone_id}/custom_pages")
end
show(id:) click to toggle source

custom_page details

# File lib/cloudflare_client/zone/custom_page.rb, line 12
def show(id:)
  raise 'id must not be nil' if id.nil?
  cf_get(path: "/zones/#{zone_id}/custom_pages/#{id}")
end
update(id:, url:, state:) click to toggle source

update_custom_page

# File lib/cloudflare_client/zone/custom_page.rb, line 19
def update(id:, url:, state:)
  id_check('id', id)
  id_check('url', url)
  raise 'state must be either default | customized' unless %w[default customized].include?(state)

  data = {url: url, state: state}

  cf_put(path: "/zones/#{zone_id}/custom_pages/#{id}", data: data)
end