lib/cloudflare_client/zone/subscription.rb
##
# create a zone subscriptions
# FIXME: api talks about lots of read only constrains
create a zone subscriptions
FIXME: api talks about lots of read only constrains
create a zone subscriptions FIXME : api talks about lots of read only constrains
def create(price:, currency:, id:, frequency:, component_values: nil, rate_plan: nil, zone: nil, state: nil)
    basic_type_check(:price, price, Numeric)
    basic_type_check(:currency, currency, String)
    basic_type_check(:id, id, String)
    max_length_check(:id, id)
    valid_value_check(:frequency, frequency, VALID_FREQUENCIES)
    data = {price: price, currency: currency, id: id, frequency: frequency}
    unless component_values.nil?
      non_empty_array_check(:component_values, component_values)
      data[:component_values] = component_values
    end
    unless rate_plan.nil?
      non_empty_hash_check(:rate_plan, rate_plan)
      data[:rate_plan] = rate_plan
    end
    unless zone.nil?
      non_empty_hash_check(:zone, zone)
      data[:zone] = zone
    end
    unless state.nil?
      valid_value_check(:state, state, VALID_STATES)
      data[:state] = state
    end
    cf_post(path: "/zones/#{zone_id}/subscription", data: data)
  end
def create ( price : , currency : , id : , frequency : , component_values : nil , rate_plan : nil , zone : nil , state : nil ) basic_type_check ( :price , price , Numeric ) basic_type_check ( :currency , currency , String ) basic_type_check ( :id , id , String ) max_length_check ( :id , id ) valid_value_check ( :frequency , frequency , VALID_FREQUENCIES ) data = { price : price , currency : currency , id : id , frequency : frequency } unless component_values . nil? non_empty_array_check ( :component_values , component_values ) data [ :component_values ] = component_values end unless rate_plan . nil? non_empty_hash_check ( :rate_plan , rate_plan ) data [ :rate_plan ] = rate_plan end unless zone . nil? non_empty_hash_check ( :zone , zone ) data [ :zone ] = zone end unless state . nil? valid_value_check ( :state , state , VALID_STATES ) data [ :state ] = state end cf_post ( path : "/zones/#{zone_id}/subscription" , data : data ) end
create a zone subscriptions
FIXME: api talks about lots of read only constrains
create a zone subscriptions FIXME : api talks about lots of read only constrains
price
<not_specific>
currency
<not_specific>
id
<not_specific>
frequency
<not_specific>
component_values
<not_specific>
rate_plan
<not_specific>
zone
<not_specific>
state
<not_specific>