Class: CropwisePlatformSdk::BasicInviteStatusAllOf
- Inherits:
-
Object
- Object
- CropwisePlatformSdk::BasicInviteStatusAllOf
- Defined in:
- lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#accepted_invite_date ⇒ Object
Full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21.
-
#account_role ⇒ Object
Returns the value of attribute account_role.
-
#email_address ⇒ Object
Returns the value of attribute email_address.
-
#invitee_user_id ⇒ Object
A v4 UUID, represented in its canonical textual form (hexadecimal, lowercase, 8-4-4-4-12 groups separated by a dash (-)).
-
#inviter_user_id ⇒ Object
A v4 UUID, represented in its canonical textual form (hexadecimal, lowercase, 8-4-4-4-12 groups separated by a dash (-)).
-
#login ⇒ Object
Returns the value of attribute login.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#sent_invite_date ⇒ Object
Full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21.
-
#user_accept_status ⇒ Object
Returns the value of attribute user_accept_status.
-
#user_invite_status ⇒ Object
Returns the value of attribute user_invite_status.
Class Method Summary collapse
-
.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.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ BasicInviteStatusAllOf
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ BasicInviteStatusAllOf
Initializes the object
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 117 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `CropwisePlatformSdk::BasicInviteStatusAllOf` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `CropwisePlatformSdk::BasicInviteStatusAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'email_address') self.email_address = attributes[:'email_address'] end if attributes.key?(:'reference') self.reference = attributes[:'reference'] end if attributes.key?(:'login') self.login = attributes[:'login'] end if attributes.key?(:'phone') self.phone = attributes[:'phone'] end if attributes.key?(:'account_role') self.account_role = attributes[:'account_role'] end if attributes.key?(:'user_invite_status') self.user_invite_status = attributes[:'user_invite_status'] end if attributes.key?(:'inviter_user_id') self.inviter_user_id = attributes[:'inviter_user_id'] end if attributes.key?(:'invitee_user_id') self.invitee_user_id = attributes[:'invitee_user_id'] end if attributes.key?(:'sent_invite_date') self.sent_invite_date = attributes[:'sent_invite_date'] end if attributes.key?(:'accepted_invite_date') self.accepted_invite_date = attributes[:'accepted_invite_date'] end if attributes.key?(:'user_accept_status') self.user_accept_status = attributes[:'user_accept_status'] end end |
Instance Attribute Details
#accepted_invite_date ⇒ Object
Full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21
42 43 44 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 42 def accepted_invite_date @accepted_invite_date end |
#account_role ⇒ Object
Returns the value of attribute account_role.
28 29 30 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 28 def account_role @account_role end |
#email_address ⇒ Object
Returns the value of attribute email_address.
20 21 22 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 20 def email_address @email_address end |
#invitee_user_id ⇒ Object
A v4 UUID, represented in its canonical textual form (hexadecimal, lowercase, 8-4-4-4-12 groups separated by a dash (-)).
36 37 38 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 36 def invitee_user_id @invitee_user_id end |
#inviter_user_id ⇒ Object
A v4 UUID, represented in its canonical textual form (hexadecimal, lowercase, 8-4-4-4-12 groups separated by a dash (-)).
33 34 35 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 33 def inviter_user_id @inviter_user_id end |
#login ⇒ Object
Returns the value of attribute login.
24 25 26 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 24 def login @login end |
#name ⇒ Object
Returns the value of attribute name.
18 19 20 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 18 def name @name end |
#phone ⇒ Object
Returns the value of attribute phone.
26 27 28 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 26 def phone @phone end |
#reference ⇒ Object
Returns the value of attribute reference.
22 23 24 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 22 def reference @reference end |
#sent_invite_date ⇒ Object
Full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21
39 40 41 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 39 def sent_invite_date @sent_invite_date end |
#user_accept_status ⇒ Object
Returns the value of attribute user_accept_status.
44 45 46 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 44 def user_accept_status @user_accept_status end |
#user_invite_status ⇒ Object
Returns the value of attribute user_invite_status.
30 31 32 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 30 def user_invite_status @user_invite_status end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
87 88 89 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 87 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 69 def self.attribute_map { :'name' => :'name', :'email_address' => :'email_address', :'reference' => :'reference', :'login' => :'login', :'phone' => :'phone', :'account_role' => :'account_role', :'user_invite_status' => :'user_invite_status', :'inviter_user_id' => :'inviter_user_id', :'invitee_user_id' => :'invitee_user_id', :'sent_invite_date' => :'sent_invite_date', :'accepted_invite_date' => :'accepted_invite_date', :'user_accept_status' => :'user_accept_status' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
262 263 264 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 262 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
110 111 112 113 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 110 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 92 def self.openapi_types { :'name' => :'String', :'email_address' => :'String', :'reference' => :'String', :'login' => :'String', :'phone' => :'String', :'account_role' => :'String', :'user_invite_status' => :'String', :'inviter_user_id' => :'String', :'invitee_user_id' => :'String', :'sent_invite_date' => :'Time', :'accepted_invite_date' => :'Time', :'user_accept_status' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 230 def ==(o) return true if self.equal?(o) self.class == o.class && name == o.name && email_address == o.email_address && reference == o.reference && login == o.login && phone == o.phone && account_role == o.account_role && user_invite_status == o.user_invite_status && inviter_user_id == o.inviter_user_id && invitee_user_id == o.invitee_user_id && sent_invite_date == o.sent_invite_date && accepted_invite_date == o.accepted_invite_date && user_accept_status == o.user_accept_status end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 293 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = CropwisePlatformSdk.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 364 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 269 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{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[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
249 250 251 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 249 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
255 256 257 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 255 def hash [name, email_address, reference, login, phone, account_role, user_invite_status, inviter_user_id, invitee_user_id, sent_invite_date, accepted_invite_date, user_accept_status].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
181 182 183 184 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 181 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
340 341 342 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 340 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 346 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 |
#to_s ⇒ String
Returns the string representation of the object
334 335 336 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 334 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
188 189 190 191 192 193 194 195 196 |
# File 'lib/cropwise-platform-sdk/models/basic_invite_status_all_of.rb', line 188 def valid? account_role_validator = EnumAttributeValidator.new('String', ["GROWER", "MANAGER", "ADMIN", "DEALER", "CONSULTANT", "AGRONOMIST", "OTHER"]) return false unless account_role_validator.valid?(@account_role) user_invite_status_validator = EnumAttributeValidator.new('String', ["PENDING", "ACCEPTED", "EXPIRED", "ONE_STEP", "CONCIERGE", "BY_LOGIN"]) return false unless user_invite_status_validator.valid?(@user_invite_status) user_accept_status_validator = EnumAttributeValidator.new('String', ["PENDING", "MANUAL", "AUTOMATIC"]) return false unless user_accept_status_validator.valid?(@user_accept_status) true end |