Class: Files::Plan

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/plan.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ Plan

Returns a new instance of Plan.



9
10
11
12
# File 'lib/files.com/models/plan.rb', line 9

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



7
8
9
# File 'lib/files.com/models/plan.rb', line 7

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/files.com/models/plan.rb', line 7

def options
  @options
end

Class Method Details

.all(params = {}, options = {}) ⇒ Object



196
197
198
# File 'lib/files.com/models/plan.rb', line 196

def self.all(params = {}, options = {})
  list(params, options)
end

.create_export(params = {}, options = {}) ⇒ Object

Parameters:

currency - string - Currency.


202
203
204
205
206
207
# File 'lib/files.com/models/plan.rb', line 202

def self.create_export(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: currency must be an String") if params[:currency] and !params[:currency].is_a?(String)

  response, options = Api.send_request("/plans/create_export", :post, params, options)
  Export.new(response.data, options)
end

.list(params = {}, options = {}) ⇒ Object

Parameters:

cursor - string - Used for pagination.  When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`.  Send one of those cursor value here to resume an existing list from the next available record.  Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
per_page - int64 - Number of records to show per page.  (Max: 10000, 1,000 or less is recommended).
currency - string - Currency.


186
187
188
189
190
191
192
193
194
# File 'lib/files.com/models/plan.rb', line 186

def self.list(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: currency must be an String") if params[:currency] and !params[:currency].is_a?(String)

  List.new(Plan, params) do
    Api.send_request("/plans", :get, params, options)
  end
end

Instance Method Details

#activation_costObject

decimal - Activation cost (upfront)



20
21
22
23
24
25
# File 'lib/files.com/models/plan.rb', line 20

def activation_cost
  value = @attributes[:activation_cost]
  return value if value.nil? || value.is_a?(BigDecimal)

  BigDecimal(value.to_s)
end

#addon_descriptionObject

string - Description of add on charges



28
29
30
# File 'lib/files.com/models/plan.rb', line 28

def addon_description
  @attributes[:addon_description]
end

#annuallyObject

string - Price annually



33
34
35
# File 'lib/files.com/models/plan.rb', line 33

def annually
  @attributes[:annually]
end

#annually_addonObject

string - Addons price annually



38
39
40
# File 'lib/files.com/models/plan.rb', line 38

def annually_addon
  @attributes[:annually_addon]
end

#automation_and_sync_flow_overage_costObject

string - Cost per additional automation and sync flow



43
44
45
# File 'lib/files.com/models/plan.rb', line 43

def automation_and_sync_flow_overage_cost
  @attributes[:automation_and_sync_flow_overage_cost]
end

#automation_and_sync_flowsObject

int64 - Number of automation and sync flows included. 0 means unlimited.



48
49
50
# File 'lib/files.com/models/plan.rb', line 48

def automation_and_sync_flows
  @attributes[:automation_and_sync_flows]
end

#child_sitesObject

int64 - Number of child sites available



53
54
55
# File 'lib/files.com/models/plan.rb', line 53

def child_sites
  @attributes[:child_sites]
end

#currencyObject

string - Currency



58
59
60
# File 'lib/files.com/models/plan.rb', line 58

def currency
  @attributes[:currency]
end

#dedicated_ipObject

boolean - Offers dedicated ip?



63
64
65
# File 'lib/files.com/models/plan.rb', line 63

def dedicated_ip
  @attributes[:dedicated_ip]
end

#dedicated_ipsObject

int64 - Number of dedicated IPs



68
69
70
# File 'lib/files.com/models/plan.rb', line 68

def dedicated_ips
  @attributes[:dedicated_ips]
end

#domain_countObject

int64 - Number of custom domains



73
74
75
# File 'lib/files.com/models/plan.rb', line 73

def domain_count
  @attributes[:domain_count]
end

#feature_bundle_ecaObject

boolean - Does this plan include the ECA feature bundle?



78
79
80
# File 'lib/files.com/models/plan.rb', line 78

def feature_bundle_eca
  @attributes[:feature_bundle_eca]
end

#feature_bundle_powerObject

boolean - Does this plan include the Power feature bundle?



83
84
85
# File 'lib/files.com/models/plan.rb', line 83

def feature_bundle_power
  @attributes[:feature_bundle_power]
end

#feature_bundle_premierObject

boolean - Does this plan include the Enterprise feature bundle?



88
89
90
# File 'lib/files.com/models/plan.rb', line 88

def feature_bundle_premier
  @attributes[:feature_bundle_premier]
end

#feature_bundle_starterObject

boolean - Does this plan include the Starter feature bundle?



93
94
95
# File 'lib/files.com/models/plan.rb', line 93

def feature_bundle_starter
  @attributes[:feature_bundle_starter]
end

#idObject

int64 - Plan ID



15
16
17
# File 'lib/files.com/models/plan.rb', line 15

def id
  @attributes[:id]
end

#monthlyObject

string - Price monthly



98
99
100
# File 'lib/files.com/models/plan.rb', line 98

def monthly
  @attributes[:monthly]
end

#monthly_addonObject

string - Addons price monthly



103
104
105
# File 'lib/files.com/models/plan.rb', line 103

def monthly_addon
  @attributes[:monthly_addon]
end

#nameObject

string - Plan name



108
109
110
# File 'lib/files.com/models/plan.rb', line 108

def name
  @attributes[:name]
end

#outbound_connectionsObject

int64 - Number of outbound connections



113
114
115
# File 'lib/files.com/models/plan.rb', line 113

def outbound_connections
  @attributes[:outbound_connections]
end

#preview_page_limitObject

int64 - Number of previews available



118
119
120
# File 'lib/files.com/models/plan.rb', line 118

def preview_page_limit
  @attributes[:preview_page_limit]
end

#regions_includedObject

int64 - Number of storage regions included



123
124
125
# File 'lib/files.com/models/plan.rb', line 123

def regions_included
  @attributes[:regions_included]
end

#remote_sync_intervalObject

int64 - Number of minutes between remote sync



128
129
130
# File 'lib/files.com/models/plan.rb', line 128

def remote_sync_interval
  @attributes[:remote_sync_interval]
end

#signup_page_marketing_textObject

string - Additional marketing text to show on signup page



133
134
135
# File 'lib/files.com/models/plan.rb', line 133

def 
  @attributes[:signup_page_marketing_text]
end

#staging_sitesObject

int64 - Number of child sites available



143
144
145
# File 'lib/files.com/models/plan.rb', line 143

def staging_sites
  @attributes[:staging_sites]
end

#system_usersObject

int64 - # of System Users included. 0 means that system users are included in the normal user quota.



138
139
140
# File 'lib/files.com/models/plan.rb', line 138

def system_users
  @attributes[:system_users]
end

#transformation_and_ai_credit_overage_cost_per_millionObject

string - Cost per million additional transformation and AI credits



148
149
150
# File 'lib/files.com/models/plan.rb', line 148

def transformation_and_ai_credit_overage_cost_per_million
  @attributes[:transformation_and_ai_credit_overage_cost_per_million]
end

#transformation_and_ai_creditsObject

int64 - Transformation and AI credits included



153
154
155
# File 'lib/files.com/models/plan.rb', line 153

def transformation_and_ai_credits
  @attributes[:transformation_and_ai_credits]
end

#trial_daysObject

int64 - # of trial days included. Values of 0 or less mean no trial is offered.



158
159
160
# File 'lib/files.com/models/plan.rb', line 158

def trial_days
  @attributes[:trial_days]
end

#usage_costObject

string - Usage cost per GB of overage



168
169
170
# File 'lib/files.com/models/plan.rb', line 168

def usage_cost
  @attributes[:usage_cost]
end

#usage_includedObject

int64 - Usage included per month, in GB



173
174
175
# File 'lib/files.com/models/plan.rb', line 173

def usage_included
  @attributes[:usage_included]
end

#user_costObject

string - Cost per additional user



163
164
165
# File 'lib/files.com/models/plan.rb', line 163

def user_cost
  @attributes[:user_cost]
end

#usersObject

int64 - # of users included. 0 or -1 mean unlimited.



178
179
180
# File 'lib/files.com/models/plan.rb', line 178

def users
  @attributes[:users]
end