Class: Shipeasy::Admin::Generated::GetCurrentProjectResponse
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Shipeasy::Admin::Generated::GetCurrentProjectResponse
- Defined in:
- lib/shipeasy_admin/models/get_current_project_response.rb
Overview
The project the caller's auth header resolves to. The shape is open — additional project fields may be present.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#billing_interval ⇒ Object
Billing cadence.
-
#cancel_at_period_end ⇒ Object
1if the subscription is set to cancel at period end, else0. -
#created_at ⇒ Object
ISO-8601 timestamp of project creation.
-
#current_period_end ⇒ Object
ISO-8601 end of the current billing period, or
null. -
#domain ⇒ Object
Project domain, or
nullif unset. -
#id ⇒ Object
Stable opaque project id.
-
#module_configs ⇒ Object
Returns the value of attribute module_configs.
-
#module_experiments ⇒ Object
Returns the value of attribute module_experiments.
-
#module_feedback ⇒ Object
Returns the value of attribute module_feedback.
-
#module_gates ⇒ Object
Returns the value of attribute module_gates.
-
#module_translations ⇒ Object
Returns the value of attribute module_translations.
-
#name ⇒ Object
Project name.
-
#owner_email ⇒ Object
Email of the account that owns the project.
-
#plan ⇒ Object
Billing plan tier.
-
#status ⇒ Object
Project lifecycle status.
-
#subscription_status ⇒ Object
Stripe subscription status (
none,active,trialing,past_due, …). -
#trial_ends_at ⇒ Object
ISO-8601 trial end, or
nullif not trialing. -
#updated_at ⇒ Object
ISO-8601 timestamp of last update.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ GetCurrentProjectResponse
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ GetCurrentProjectResponse
Initializes the object
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 159 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::GetCurrentProjectResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Shipeasy::Admin::Generated::GetCurrentProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'domain') self.domain = attributes[:'domain'] else self.domain = nil end if attributes.key?(:'owner_email') self.owner_email = attributes[:'owner_email'] else self.owner_email = nil end if attributes.key?(:'plan') self.plan = attributes[:'plan'] else self.plan = nil end if attributes.key?(:'status') self.status = attributes[:'status'] else self.status = nil end if attributes.key?(:'subscription_status') self.subscription_status = attributes[:'subscription_status'] else self.subscription_status = nil end if attributes.key?(:'billing_interval') self.billing_interval = attributes[:'billing_interval'] else self.billing_interval = nil end if attributes.key?(:'current_period_end') self.current_period_end = attributes[:'current_period_end'] else self.current_period_end = nil end if attributes.key?(:'trial_ends_at') self.trial_ends_at = attributes[:'trial_ends_at'] else self.trial_ends_at = nil end if attributes.key?(:'cancel_at_period_end') self.cancel_at_period_end = attributes[:'cancel_at_period_end'] else self.cancel_at_period_end = nil end if attributes.key?(:'module_translations') self.module_translations = attributes[:'module_translations'] else self.module_translations = nil end if attributes.key?(:'module_configs') self.module_configs = attributes[:'module_configs'] else self.module_configs = nil end if attributes.key?(:'module_gates') self.module_gates = attributes[:'module_gates'] else self.module_gates = nil end if attributes.key?(:'module_experiments') self.module_experiments = attributes[:'module_experiments'] else self.module_experiments = nil end if attributes.key?(:'module_feedback') self.module_feedback = attributes[:'module_feedback'] else self.module_feedback = nil end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] else self.created_at = nil end if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] else self.updated_at = nil end end |
Instance Attribute Details
#billing_interval ⇒ Object
Billing cadence.
41 42 43 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 41 def billing_interval @billing_interval end |
#cancel_at_period_end ⇒ Object
1 if the subscription is set to cancel at period end, else 0.
50 51 52 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 50 def cancel_at_period_end @cancel_at_period_end end |
#created_at ⇒ Object
ISO-8601 timestamp of project creation.
63 64 65 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 63 def created_at @created_at end |
#current_period_end ⇒ Object
ISO-8601 end of the current billing period, or null.
44 45 46 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 44 def current_period_end @current_period_end end |
#domain ⇒ Object
Project domain, or null if unset.
26 27 28 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 26 def domain @domain end |
#id ⇒ Object
Stable opaque project id.
20 21 22 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 20 def id @id end |
#module_configs ⇒ Object
Returns the value of attribute module_configs.
54 55 56 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 54 def module_configs @module_configs end |
#module_experiments ⇒ Object
Returns the value of attribute module_experiments.
58 59 60 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 58 def module_experiments @module_experiments end |
#module_feedback ⇒ Object
Returns the value of attribute module_feedback.
60 61 62 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 60 def module_feedback @module_feedback end |
#module_gates ⇒ Object
Returns the value of attribute module_gates.
56 57 58 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 56 def module_gates @module_gates end |
#module_translations ⇒ Object
Returns the value of attribute module_translations.
52 53 54 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 52 def module_translations @module_translations end |
#name ⇒ Object
Project name.
23 24 25 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 23 def name @name end |
#owner_email ⇒ Object
Email of the account that owns the project.
29 30 31 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 29 def owner_email @owner_email end |
#plan ⇒ Object
Billing plan tier.
32 33 34 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 32 def plan @plan end |
#status ⇒ Object
Project lifecycle status.
35 36 37 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 35 def status @status end |
#subscription_status ⇒ Object
Stripe subscription status (none, active, trialing, past_due, …).
38 39 40 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 38 def subscription_status @subscription_status end |
#trial_ends_at ⇒ Object
ISO-8601 trial end, or null if not trialing.
47 48 49 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 47 def trial_ends_at @trial_ends_at end |
#updated_at ⇒ Object
ISO-8601 timestamp of last update.
66 67 68 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 66 def updated_at @updated_at end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
115 116 117 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 115 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
120 121 122 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 120 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 91 def self.attribute_map { :'id' => :'id', :'name' => :'name', :'domain' => :'domain', :'owner_email' => :'ownerEmail', :'plan' => :'plan', :'status' => :'status', :'subscription_status' => :'subscriptionStatus', :'billing_interval' => :'billingInterval', :'current_period_end' => :'currentPeriodEnd', :'trial_ends_at' => :'trialEndsAt', :'cancel_at_period_end' => :'cancelAtPeriodEnd', :'module_translations' => :'moduleTranslations', :'module_configs' => :'moduleConfigs', :'module_gates' => :'moduleGates', :'module_experiments' => :'moduleExperiments', :'module_feedback' => :'moduleFeedback', :'created_at' => :'createdAt', :'updated_at' => :'updatedAt' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 568 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
149 150 151 152 153 154 155 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 149 def self.openapi_nullable Set.new([ :'domain', :'current_period_end', :'trial_ends_at', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 125 def self.openapi_types { :'id' => :'String', :'name' => :'String', :'domain' => :'String', :'owner_email' => :'String', :'plan' => :'String', :'status' => :'String', :'subscription_status' => :'String', :'billing_interval' => :'String', :'current_period_end' => :'String', :'trial_ends_at' => :'String', :'cancel_at_period_end' => :'Float', :'module_translations' => :'GetCurrentProjectResponseModuleTranslations', :'module_configs' => :'GetCurrentProjectResponseModuleTranslations', :'module_gates' => :'GetCurrentProjectResponseModuleTranslations', :'module_experiments' => :'GetCurrentProjectResponseModuleTranslations', :'module_feedback' => :'GetCurrentProjectResponseModuleTranslations', :'created_at' => :'String', :'updated_at' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 530 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && domain == o.domain && owner_email == o.owner_email && plan == o.plan && status == o.status && subscription_status == o.subscription_status && billing_interval == o.billing_interval && current_period_end == o.current_period_end && trial_ends_at == o.trial_ends_at && cancel_at_period_end == o.cancel_at_period_end && module_translations == o.module_translations && module_configs == o.module_configs && module_gates == o.module_gates && module_experiments == o.module_experiments && module_feedback == o.module_feedback && created_at == o.created_at && updated_at == o.updated_at end |
#eql?(o) ⇒ Boolean
555 556 557 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 555 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
561 562 563 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 561 def hash [id, name, domain, owner_email, plan, status, subscription_status, billing_interval, current_period_end, trial_ends_at, cancel_at_period_end, module_translations, module_configs, module_gates, module_experiments, module_feedback, created_at, updated_at].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 284 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @owner_email.nil? invalid_properties.push('invalid value for "owner_email", owner_email cannot be nil.') end if @plan.nil? invalid_properties.push('invalid value for "plan", plan cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @subscription_status.nil? invalid_properties.push('invalid value for "subscription_status", subscription_status cannot be nil.') end if @billing_interval.nil? invalid_properties.push('invalid value for "billing_interval", billing_interval cannot be nil.') end if @cancel_at_period_end.nil? invalid_properties.push('invalid value for "cancel_at_period_end", cancel_at_period_end cannot be nil.') end if @module_translations.nil? invalid_properties.push('invalid value for "module_translations", module_translations cannot be nil.') end if @module_configs.nil? invalid_properties.push('invalid value for "module_configs", module_configs cannot be nil.') end if @module_gates.nil? invalid_properties.push('invalid value for "module_gates", module_gates cannot be nil.') end if @module_experiments.nil? invalid_properties.push('invalid value for "module_experiments", module_experiments cannot be nil.') end if @module_feedback.nil? invalid_properties.push('invalid value for "module_feedback", module_feedback cannot be nil.') end if @created_at.nil? invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') end if @updated_at.nil? invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
590 591 592 593 594 595 596 597 598 599 600 601 602 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 590 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/shipeasy_admin/models/get_current_project_response.rb', line 352 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @name.nil? return false if @owner_email.nil? return false if @plan.nil? plan_validator = EnumAttributeValidator.new('String', ["free", "paid"]) return false unless plan_validator.valid?(@plan) return false if @status.nil? status_validator = EnumAttributeValidator.new('String', ["active", "inactive"]) return false unless status_validator.valid?(@status) return false if @subscription_status.nil? return false if @billing_interval.nil? billing_interval_validator = EnumAttributeValidator.new('String', ["monthly", "annual"]) return false unless billing_interval_validator.valid?(@billing_interval) return false if @cancel_at_period_end.nil? return false if @module_translations.nil? return false if @module_configs.nil? return false if @module_gates.nil? return false if @module_experiments.nil? return false if @module_feedback.nil? return false if @created_at.nil? return false if @updated_at.nil? true end |