Class: Lockally::CalendarPolicies
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Lockally::CalendarPolicies
- Defined in:
- lib/lockally/models/calendar_policies.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#booking_window_days ⇒ Object
Returns the value of attribute booking_window_days.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#external_invites_allowed ⇒ Object
Returns the value of attribute external_invites_allowed.
-
#external_sharing_allowed ⇒ Object
Returns the value of attribute external_sharing_allowed.
-
#max_meeting_duration_mins ⇒ Object
Returns the value of attribute max_meeting_duration_mins.
-
#public_links_enabled ⇒ Object
Returns the value of attribute public_links_enabled.
-
#recurring_meeting_limit ⇒ Object
Returns the value of attribute recurring_meeting_limit.
-
#resource_approval_mode ⇒ Object
Returns the value of attribute resource_approval_mode.
-
#tenant_id ⇒ Object
Returns the value of attribute tenant_id.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#working_hours_end ⇒ Object
Returns the value of attribute working_hours_end.
-
#working_hours_start ⇒ Object
Returns the value of attribute working_hours_start.
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 = {}) ⇒ CalendarPolicies
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 = {}) ⇒ CalendarPolicies
Initializes the object
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 178 179 180 181 |
# File 'lib/lockally/models/calendar_policies.rb', line 118 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Lockally::CalendarPolicies` 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 `Lockally::CalendarPolicies`. 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?(:'tenant_id') self.tenant_id = attributes[:'tenant_id'] else self.tenant_id = nil end if attributes.key?(:'max_meeting_duration_mins') self.max_meeting_duration_mins = attributes[:'max_meeting_duration_mins'] end if attributes.key?(:'working_hours_start') self.working_hours_start = attributes[:'working_hours_start'] end if attributes.key?(:'working_hours_end') self.working_hours_end = attributes[:'working_hours_end'] end if attributes.key?(:'booking_window_days') self.booking_window_days = attributes[:'booking_window_days'] end if attributes.key?(:'recurring_meeting_limit') self.recurring_meeting_limit = attributes[:'recurring_meeting_limit'] end if attributes.key?(:'resource_approval_mode') self.resource_approval_mode = attributes[:'resource_approval_mode'] end if attributes.key?(:'external_invites_allowed') self.external_invites_allowed = attributes[:'external_invites_allowed'] end if attributes.key?(:'external_sharing_allowed') self.external_sharing_allowed = attributes[:'external_sharing_allowed'] end if attributes.key?(:'public_links_enabled') self.public_links_enabled = attributes[:'public_links_enabled'] end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] end end |
Instance Attribute Details
#booking_window_days ⇒ Object
Returns the value of attribute booking_window_days.
26 27 28 |
# File 'lib/lockally/models/calendar_policies.rb', line 26 def booking_window_days @booking_window_days end |
#created_at ⇒ Object
Returns the value of attribute created_at.
38 39 40 |
# File 'lib/lockally/models/calendar_policies.rb', line 38 def created_at @created_at end |
#external_invites_allowed ⇒ Object
Returns the value of attribute external_invites_allowed.
32 33 34 |
# File 'lib/lockally/models/calendar_policies.rb', line 32 def external_invites_allowed @external_invites_allowed end |
#external_sharing_allowed ⇒ Object
Returns the value of attribute external_sharing_allowed.
34 35 36 |
# File 'lib/lockally/models/calendar_policies.rb', line 34 def external_sharing_allowed @external_sharing_allowed end |
#max_meeting_duration_mins ⇒ Object
Returns the value of attribute max_meeting_duration_mins.
20 21 22 |
# File 'lib/lockally/models/calendar_policies.rb', line 20 def max_meeting_duration_mins @max_meeting_duration_mins end |
#public_links_enabled ⇒ Object
Returns the value of attribute public_links_enabled.
36 37 38 |
# File 'lib/lockally/models/calendar_policies.rb', line 36 def public_links_enabled @public_links_enabled end |
#recurring_meeting_limit ⇒ Object
Returns the value of attribute recurring_meeting_limit.
28 29 30 |
# File 'lib/lockally/models/calendar_policies.rb', line 28 def recurring_meeting_limit @recurring_meeting_limit end |
#resource_approval_mode ⇒ Object
Returns the value of attribute resource_approval_mode.
30 31 32 |
# File 'lib/lockally/models/calendar_policies.rb', line 30 def resource_approval_mode @resource_approval_mode end |
#tenant_id ⇒ Object
Returns the value of attribute tenant_id.
18 19 20 |
# File 'lib/lockally/models/calendar_policies.rb', line 18 def tenant_id @tenant_id end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
40 41 42 |
# File 'lib/lockally/models/calendar_policies.rb', line 40 def updated_at @updated_at end |
#working_hours_end ⇒ Object
Returns the value of attribute working_hours_end.
24 25 26 |
# File 'lib/lockally/models/calendar_policies.rb', line 24 def working_hours_end @working_hours_end end |
#working_hours_start ⇒ Object
Returns the value of attribute working_hours_start.
22 23 24 |
# File 'lib/lockally/models/calendar_policies.rb', line 22 def working_hours_start @working_hours_start end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
83 84 85 |
# File 'lib/lockally/models/calendar_policies.rb', line 83 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
88 89 90 |
# File 'lib/lockally/models/calendar_policies.rb', line 88 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/lockally/models/calendar_policies.rb', line 65 def self.attribute_map { :'tenant_id' => :'tenant_id', :'max_meeting_duration_mins' => :'max_meeting_duration_mins', :'working_hours_start' => :'working_hours_start', :'working_hours_end' => :'working_hours_end', :'booking_window_days' => :'booking_window_days', :'recurring_meeting_limit' => :'recurring_meeting_limit', :'resource_approval_mode' => :'resource_approval_mode', :'external_invites_allowed' => :'external_invites_allowed', :'external_sharing_allowed' => :'external_sharing_allowed', :'public_links_enabled' => :'public_links_enabled', :'created_at' => :'created_at', :'updated_at' => :'updated_at' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/lockally/models/calendar_policies.rb', line 259 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
111 112 113 114 |
# File 'lib/lockally/models/calendar_policies.rb', line 111 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/lockally/models/calendar_policies.rb', line 93 def self.openapi_types { :'tenant_id' => :'String', :'max_meeting_duration_mins' => :'Integer', :'working_hours_start' => :'String', :'working_hours_end' => :'String', :'booking_window_days' => :'Integer', :'recurring_meeting_limit' => :'Integer', :'resource_approval_mode' => :'String', :'external_invites_allowed' => :'Boolean', :'external_sharing_allowed' => :'Boolean', :'public_links_enabled' => :'Boolean', :'created_at' => :'Time', :'updated_at' => :'Time' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/lockally/models/calendar_policies.rb', line 227 def ==(o) return true if self.equal?(o) self.class == o.class && tenant_id == o.tenant_id && max_meeting_duration_mins == o.max_meeting_duration_mins && working_hours_start == o.working_hours_start && working_hours_end == o.working_hours_end && booking_window_days == o.booking_window_days && recurring_meeting_limit == o.recurring_meeting_limit && resource_approval_mode == o.resource_approval_mode && external_invites_allowed == o.external_invites_allowed && external_sharing_allowed == o.external_sharing_allowed && public_links_enabled == o.public_links_enabled && created_at == o.created_at && updated_at == o.updated_at end |
#eql?(o) ⇒ Boolean
246 247 248 |
# File 'lib/lockally/models/calendar_policies.rb', line 246 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
252 253 254 |
# File 'lib/lockally/models/calendar_policies.rb', line 252 def hash [tenant_id, max_meeting_duration_mins, working_hours_start, working_hours_end, booking_window_days, recurring_meeting_limit, resource_approval_mode, external_invites_allowed, external_sharing_allowed, public_links_enabled, created_at, updated_at].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
185 186 187 188 189 190 191 192 193 |
# File 'lib/lockally/models/calendar_policies.rb', line 185 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @tenant_id.nil? invalid_properties.push('invalid value for "tenant_id", tenant_id cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
281 282 283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/lockally/models/calendar_policies.rb', line 281 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
197 198 199 200 201 202 203 |
# File 'lib/lockally/models/calendar_policies.rb', line 197 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @tenant_id.nil? resource_approval_mode_validator = EnumAttributeValidator.new('String', ["auto_approve", "require_approval", "restricted"]) return false unless resource_approval_mode_validator.valid?(@resource_approval_mode) true end |