Class: Repull::ListingContentUpdateRequestPolicies
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Repull::ListingContentUpdateRequestPolicies
- Defined in:
- lib/repull/models/listing_content_update_request_policies.rb
Instance Attribute Summary collapse
-
#allows_children ⇒ Object
Returns the value of attribute allows_children.
-
#allows_events ⇒ Object
Returns the value of attribute allows_events.
-
#allows_infants ⇒ Object
Returns the value of attribute allows_infants.
-
#allows_pets ⇒ Object
Returns the value of attribute allows_pets.
-
#allows_smoking ⇒ Object
Returns the value of attribute allows_smoking.
-
#cancellation ⇒ Object
Alias for
cancellationPolicy. -
#cancellation_policy ⇒ Object
Cancellation policy slug/label.
-
#check_in_time_end ⇒ Object
Returns the value of attribute check_in_time_end.
-
#check_in_time_start ⇒ Object
e.g.
-
#check_out_time ⇒ Object
e.g.
-
#house_rules ⇒ Object
Free-text house rules.
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 = {}) ⇒ ListingContentUpdateRequestPolicies
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 = {}) ⇒ ListingContentUpdateRequestPolicies
Initializes the object
108 109 110 111 112 113 114 115 116 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 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 108 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingContentUpdateRequestPolicies` 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 `Repull::ListingContentUpdateRequestPolicies`. 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?(:'check_in_time_start') self.check_in_time_start = attributes[:'check_in_time_start'] end if attributes.key?(:'check_in_time_end') self.check_in_time_end = attributes[:'check_in_time_end'] end if attributes.key?(:'check_out_time') self.check_out_time = attributes[:'check_out_time'] end if attributes.key?(:'house_rules') self.house_rules = attributes[:'house_rules'] end if attributes.key?(:'cancellation_policy') self.cancellation_policy = attributes[:'cancellation_policy'] end if attributes.key?(:'cancellation') self.cancellation = attributes[:'cancellation'] end if attributes.key?(:'allows_children') self.allows_children = attributes[:'allows_children'] end if attributes.key?(:'allows_infants') self.allows_infants = attributes[:'allows_infants'] end if attributes.key?(:'allows_pets') self.allows_pets = attributes[:'allows_pets'] end if attributes.key?(:'allows_smoking') self.allows_smoking = attributes[:'allows_smoking'] end if attributes.key?(:'allows_events') self.allows_events = attributes[:'allows_events'] end end |
Instance Attribute Details
#allows_children ⇒ Object
Returns the value of attribute allows_children.
35 36 37 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 35 def allows_children @allows_children end |
#allows_events ⇒ Object
Returns the value of attribute allows_events.
43 44 45 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 43 def allows_events @allows_events end |
#allows_infants ⇒ Object
Returns the value of attribute allows_infants.
37 38 39 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 37 def allows_infants @allows_infants end |
#allows_pets ⇒ Object
Returns the value of attribute allows_pets.
39 40 41 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 39 def allows_pets @allows_pets end |
#allows_smoking ⇒ Object
Returns the value of attribute allows_smoking.
41 42 43 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 41 def allows_smoking @allows_smoking end |
#cancellation ⇒ Object
Alias for cancellationPolicy.
33 34 35 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 33 def cancellation @cancellation end |
#cancellation_policy ⇒ Object
Cancellation policy slug/label.
30 31 32 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 30 def cancellation_policy @cancellation_policy end |
#check_in_time_end ⇒ Object
Returns the value of attribute check_in_time_end.
21 22 23 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 21 def check_in_time_end @check_in_time_end end |
#check_in_time_start ⇒ Object
e.g. "15" (3pm).
19 20 21 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 19 def check_in_time_start @check_in_time_start end |
#check_out_time ⇒ Object
e.g. "11" (11am).
24 25 26 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 24 def check_out_time @check_out_time end |
#house_rules ⇒ Object
Free-text house rules.
27 28 29 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 27 def house_rules @house_rules end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
63 64 65 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 63 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
68 69 70 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 68 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 46 def self.attribute_map { :'check_in_time_start' => :'checkInTimeStart', :'check_in_time_end' => :'checkInTimeEnd', :'check_out_time' => :'checkOutTime', :'house_rules' => :'houseRules', :'cancellation_policy' => :'cancellationPolicy', :'cancellation' => :'cancellation', :'allows_children' => :'allowsChildren', :'allows_infants' => :'allowsInfants', :'allows_pets' => :'allowsPets', :'allows_smoking' => :'allowsSmoking', :'allows_events' => :'allowsEvents' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 215 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
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 90 def self.openapi_nullable Set.new([ :'check_in_time_start', :'check_in_time_end', :'check_out_time', :'house_rules', :'cancellation_policy', :'cancellation', :'allows_children', :'allows_infants', :'allows_pets', :'allows_smoking', :'allows_events' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 73 def self.openapi_types { :'check_in_time_start' => :'String', :'check_in_time_end' => :'String', :'check_out_time' => :'String', :'house_rules' => :'String', :'cancellation_policy' => :'String', :'cancellation' => :'String', :'allows_children' => :'Boolean', :'allows_infants' => :'Boolean', :'allows_pets' => :'Boolean', :'allows_smoking' => :'Boolean', :'allows_events' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 184 def ==(o) return true if self.equal?(o) self.class == o.class && check_in_time_start == o.check_in_time_start && check_in_time_end == o.check_in_time_end && check_out_time == o.check_out_time && house_rules == o.house_rules && cancellation_policy == o.cancellation_policy && cancellation == o.cancellation && allows_children == o.allows_children && allows_infants == o.allows_infants && allows_pets == o.allows_pets && allows_smoking == o.allows_smoking && allows_events == o.allows_events end |
#eql?(o) ⇒ Boolean
202 203 204 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 202 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
208 209 210 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 208 def hash [check_in_time_start, check_in_time_end, check_out_time, house_rules, cancellation_policy, cancellation, allows_children, allows_infants, allows_pets, allows_smoking, allows_events].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
169 170 171 172 173 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 169 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
237 238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 237 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
177 178 179 180 |
# File 'lib/repull/models/listing_content_update_request_policies.rb', line 177 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |