Class: MistApi::AdminInvite
- Defined in:
- lib/mist_api/models/admin_invite.rb
Overview
AdminInvite Model.
Instance Attribute Summary collapse
-
#account_only ⇒ TrueClass | FalseClass
Skip creating initial setup if true.
-
#allow_mist ⇒ TrueClass | FalseClass
Whether to allow Mist to look at this org.
-
#city ⇒ String
City of registering user.
-
#country ⇒ String
Country/region name or ISO code of registering user.
-
#email ⇒ String
Country/region name or ISO code of registering user.
-
#first_name ⇒ String
Country/region name or ISO code of registering user.
-
#invite_code ⇒ String
Required initially.
-
#last_name ⇒ String
Required initially.
-
#org_name ⇒ String
Required initially.
-
#password ⇒ String
Required initially.
-
#recaptcha ⇒ String
reCAPTCHA , see www.google.com/recaptcha/.
-
#recaptcha_flavor ⇒ RecaptchaFlavorEnum
flavor of the captcha.
-
#referer_invite_token ⇒ String
Invite token to apply after account creation.
-
#return_to ⇒ String
URL the user should be redirected back to.
-
#state ⇒ String
State name or ISO code of registering user, optional (depends on country/region).
-
#street_address ⇒ String
Street address of registering user.
-
#street_address_2 ⇒ String
Street address 2 of registering user.
-
#zipcode ⇒ String
zipcode of registering user.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(email = nil, first_name = nil, last_name = nil, org_name = nil, password = nil, recaptcha = nil, account_only = false, allow_mist = false, city = SKIP, country = SKIP, invite_code = SKIP, recaptcha_flavor = RecaptchaFlavorEnum::GOOGLE, referer_invite_token = SKIP, return_to = SKIP, state = SKIP, street_address = SKIP, street_address_2 = SKIP, zipcode = SKIP, additional_properties = nil) ⇒ AdminInvite
constructor
A new instance of AdminInvite.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(email = nil, first_name = nil, last_name = nil, org_name = nil, password = nil, recaptcha = nil, account_only = false, allow_mist = false, city = SKIP, country = SKIP, invite_code = SKIP, recaptcha_flavor = RecaptchaFlavorEnum::GOOGLE, referer_invite_token = SKIP, return_to = SKIP, state = SKIP, street_address = SKIP, street_address_2 = SKIP, zipcode = SKIP, additional_properties = nil) ⇒ AdminInvite
Returns a new instance of AdminInvite.
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/mist_api/models/admin_invite.rb', line 132 def initialize(email = nil, first_name = nil, last_name = nil, org_name = nil, password = nil, recaptcha = nil, account_only = false, allow_mist = false, city = SKIP, country = SKIP, invite_code = SKIP, recaptcha_flavor = RecaptchaFlavorEnum::GOOGLE, referer_invite_token = SKIP, return_to = SKIP, state = SKIP, street_address = SKIP, street_address_2 = SKIP, zipcode = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_only = account_only unless account_only == SKIP @allow_mist = allow_mist unless allow_mist == SKIP @city = city unless city == SKIP @country = country unless country == SKIP @email = email @first_name = first_name @invite_code = invite_code unless invite_code == SKIP @last_name = last_name @org_name = org_name @password = password @recaptcha = recaptcha @recaptcha_flavor = recaptcha_flavor unless recaptcha_flavor == SKIP @referer_invite_token = referer_invite_token unless referer_invite_token == SKIP @return_to = return_to unless return_to == SKIP @state = state unless state == SKIP @street_address = street_address unless street_address == SKIP @street_address_2 = street_address_2 unless street_address_2 == SKIP @zipcode = zipcode unless zipcode == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_only ⇒ TrueClass | FalseClass
Skip creating initial setup if true
14 15 16 |
# File 'lib/mist_api/models/admin_invite.rb', line 14 def account_only @account_only end |
#allow_mist ⇒ TrueClass | FalseClass
Whether to allow Mist to look at this org
18 19 20 |
# File 'lib/mist_api/models/admin_invite.rb', line 18 def allow_mist @allow_mist end |
#city ⇒ String
City of registering user
22 23 24 |
# File 'lib/mist_api/models/admin_invite.rb', line 22 def city @city end |
#country ⇒ String
Country/region name or ISO code of registering user
26 27 28 |
# File 'lib/mist_api/models/admin_invite.rb', line 26 def country @country end |
#email ⇒ String
Country/region name or ISO code of registering user
30 31 32 |
# File 'lib/mist_api/models/admin_invite.rb', line 30 def email @email end |
#first_name ⇒ String
Country/region name or ISO code of registering user
34 35 36 |
# File 'lib/mist_api/models/admin_invite.rb', line 34 def first_name @first_name end |
#invite_code ⇒ String
Required initially
38 39 40 |
# File 'lib/mist_api/models/admin_invite.rb', line 38 def invite_code @invite_code end |
#last_name ⇒ String
Required initially
42 43 44 |
# File 'lib/mist_api/models/admin_invite.rb', line 42 def last_name @last_name end |
#org_name ⇒ String
Required initially
46 47 48 |
# File 'lib/mist_api/models/admin_invite.rb', line 46 def org_name @org_name end |
#password ⇒ String
Required initially
50 51 52 |
# File 'lib/mist_api/models/admin_invite.rb', line 50 def password @password end |
#recaptcha ⇒ String
reCAPTCHA , see www.google.com/recaptcha/
54 55 56 |
# File 'lib/mist_api/models/admin_invite.rb', line 54 def recaptcha @recaptcha end |
#recaptcha_flavor ⇒ RecaptchaFlavorEnum
flavor of the captcha. enum: ‘google`, `hcaptcha`
58 59 60 |
# File 'lib/mist_api/models/admin_invite.rb', line 58 def recaptcha_flavor @recaptcha_flavor end |
#referer_invite_token ⇒ String
Invite token to apply after account creation
62 63 64 |
# File 'lib/mist_api/models/admin_invite.rb', line 62 def referer_invite_token @referer_invite_token end |
#return_to ⇒ String
URL the user should be redirected back to
66 67 68 |
# File 'lib/mist_api/models/admin_invite.rb', line 66 def return_to @return_to end |
#state ⇒ String
State name or ISO code of registering user, optional (depends on country/region)
71 72 73 |
# File 'lib/mist_api/models/admin_invite.rb', line 71 def state @state end |
#street_address ⇒ String
Street address of registering user
75 76 77 |
# File 'lib/mist_api/models/admin_invite.rb', line 75 def street_address @street_address end |
#street_address_2 ⇒ String
Street address 2 of registering user
79 80 81 |
# File 'lib/mist_api/models/admin_invite.rb', line 79 def street_address_2 @street_address_2 end |
#zipcode ⇒ String
zipcode of registering user
83 84 85 |
# File 'lib/mist_api/models/admin_invite.rb', line 83 def zipcode @zipcode end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/mist_api/models/admin_invite.rb', line 165 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. email = hash.key?('email') ? hash['email'] : nil first_name = hash.key?('first_name') ? hash['first_name'] : nil last_name = hash.key?('last_name') ? hash['last_name'] : nil org_name = hash.key?('org_name') ? hash['org_name'] : nil password = hash.key?('password') ? hash['password'] : nil recaptcha = hash.key?('recaptcha') ? hash['recaptcha'] : nil account_only = hash['account_only'] ||= false allow_mist = hash['allow_mist'] ||= false city = hash.key?('city') ? hash['city'] : SKIP country = hash.key?('country') ? hash['country'] : SKIP invite_code = hash.key?('invite_code') ? hash['invite_code'] : SKIP recaptcha_flavor = hash['recaptcha_flavor'] ||= RecaptchaFlavorEnum::GOOGLE referer_invite_token = hash.key?('referer_invite_token') ? hash['referer_invite_token'] : SKIP return_to = hash.key?('return_to') ? hash['return_to'] : SKIP state = hash.key?('state') ? hash['state'] : SKIP street_address = hash.key?('street_address') ? hash['street_address'] : SKIP street_address_2 = hash.key?('street_address 2') ? hash['street_address 2'] : SKIP zipcode = hash.key?('zipcode') ? hash['zipcode'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. AdminInvite.new(email, first_name, last_name, org_name, password, recaptcha, account_only, allow_mist, city, country, invite_code, recaptcha_flavor, referer_invite_token, return_to, state, street_address, street_address_2, zipcode, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/mist_api/models/admin_invite.rb', line 86 def self.names @_hash = {} if @_hash.nil? @_hash['account_only'] = 'account_only' @_hash['allow_mist'] = 'allow_mist' @_hash['city'] = 'city' @_hash['country'] = 'country' @_hash['email'] = 'email' @_hash['first_name'] = 'first_name' @_hash['invite_code'] = 'invite_code' @_hash['last_name'] = 'last_name' @_hash['org_name'] = 'org_name' @_hash['password'] = 'password' @_hash['recaptcha'] = 'recaptcha' @_hash['recaptcha_flavor'] = 'recaptcha_flavor' @_hash['referer_invite_token'] = 'referer_invite_token' @_hash['return_to'] = 'return_to' @_hash['state'] = 'state' @_hash['street_address'] = 'street_address' @_hash['street_address_2'] = 'street_address 2' @_hash['zipcode'] = 'zipcode' @_hash end |
.nullables ⇒ Object
An array for nullable fields
128 129 130 |
# File 'lib/mist_api/models/admin_invite.rb', line 128 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/mist_api/models/admin_invite.rb', line 110 def self.optionals %w[ account_only allow_mist city country invite_code recaptcha_flavor referer_invite_token return_to state street_address street_address_2 zipcode ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/mist_api/models/admin_invite.rb', line 234 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_only: #{@account_only.inspect}, allow_mist: #{@allow_mist.inspect},"\ " city: #{@city.inspect}, country: #{@country.inspect}, email: #{@email.inspect},"\ " first_name: #{@first_name.inspect}, invite_code: #{@invite_code.inspect}, last_name:"\ " #{@last_name.inspect}, org_name: #{@org_name.inspect}, password: #{@password.inspect},"\ " recaptcha: #{@recaptcha.inspect}, recaptcha_flavor: #{@recaptcha_flavor.inspect},"\ " referer_invite_token: #{@referer_invite_token.inspect}, return_to: #{@return_to.inspect},"\ " state: #{@state.inspect}, street_address: #{@street_address.inspect}, street_address_2:"\ " #{@street_address_2.inspect}, zipcode: #{@zipcode.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
222 223 224 225 226 227 228 229 230 231 |
# File 'lib/mist_api/models/admin_invite.rb', line 222 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_only: #{@account_only}, allow_mist: #{@allow_mist}, city: #{@city},"\ " country: #{@country}, email: #{@email}, first_name: #{@first_name}, invite_code:"\ " #{@invite_code}, last_name: #{@last_name}, org_name: #{@org_name}, password: #{@password},"\ " recaptcha: #{@recaptcha}, recaptcha_flavor: #{@recaptcha_flavor}, referer_invite_token:"\ " #{@referer_invite_token}, return_to: #{@return_to}, state: #{@state}, street_address:"\ " #{@street_address}, street_address_2: #{@street_address_2}, zipcode: #{@zipcode},"\ " additional_properties: #{@additional_properties}>" end |