Class: FattureInCloud_Ruby_Sdk::Permissions

Inherits:
Object
  • Object
show all
Defined in:
lib/fattureincloud_ruby_sdk/models/permissions.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Permissions

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 167

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `FattureInCloud_Ruby_Sdk::Permissions` 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 `FattureInCloud_Ruby_Sdk::Permissions`. 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?(:'fic_situation')
    self.fic_situation = attributes[:'fic_situation']
  end

  if attributes.key?(:'fic_clients')
    self.fic_clients = attributes[:'fic_clients']
  end

  if attributes.key?(:'fic_suppliers')
    self.fic_suppliers = attributes[:'fic_suppliers']
  end

  if attributes.key?(:'fic_products')
    self.fic_products = attributes[:'fic_products']
  end

  if attributes.key?(:'fic_issued_documents')
    self.fic_issued_documents = attributes[:'fic_issued_documents']
  end

  if attributes.key?(:'fic_received_documents')
    self.fic_received_documents = attributes[:'fic_received_documents']
  end

  if attributes.key?(:'fic_receipts')
    self.fic_receipts = attributes[:'fic_receipts']
  end

  if attributes.key?(:'fic_calendar')
    self.fic_calendar = attributes[:'fic_calendar']
  end

  if attributes.key?(:'fic_archive')
    self.fic_archive = attributes[:'fic_archive']
  end

  if attributes.key?(:'fic_taxes')
    self.fic_taxes = attributes[:'fic_taxes']
  end

  if attributes.key?(:'fic_stock')
    self.fic_stock = attributes[:'fic_stock']
  end

  if attributes.key?(:'fic_cashbook')
    self.fic_cashbook = attributes[:'fic_cashbook']
  end

  if attributes.key?(:'fic_settings')
    self.fic_settings = attributes[:'fic_settings']
  end

  if attributes.key?(:'fic_emails')
    self.fic_emails = attributes[:'fic_emails']
  end

  if attributes.key?(:'fic_export')
    self.fic_export = attributes[:'fic_export']
  end

  if attributes.key?(:'fic_import_bankstatements')
    self.fic_import_bankstatements = attributes[:'fic_import_bankstatements']
  end

  if attributes.key?(:'fic_import_clients_suppliers')
    self.fic_import_clients_suppliers = attributes[:'fic_import_clients_suppliers']
  end

  if attributes.key?(:'fic_import_issued_documents')
    self.fic_import_issued_documents = attributes[:'fic_import_issued_documents']
  end

  if attributes.key?(:'fic_import_products')
    self.fic_import_products = attributes[:'fic_import_products']
  end

  if attributes.key?(:'fic_recurring')
    self.fic_recurring = attributes[:'fic_recurring']
  end

  if attributes.key?(:'fic_riba')
    self.fic_riba = attributes[:'fic_riba']
  end

  if attributes.key?(:'dic_employees')
    self.dic_employees = attributes[:'dic_employees']
  end

  if attributes.key?(:'dic_settings')
    self.dic_settings = attributes[:'dic_settings']
  end

  if attributes.key?(:'dic_timesheet')
    self.dic_timesheet = attributes[:'dic_timesheet']
  end

  if attributes.key?(:'fic_issued_documents_detailed')
    self.fic_issued_documents_detailed = attributes[:'fic_issued_documents_detailed']
  end
end

Instance Attribute Details

#dic_employeesObject

Returns the value of attribute dic_employees.



61
62
63
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 61

def dic_employees
  @dic_employees
end

#dic_settingsObject

Returns the value of attribute dic_settings.



63
64
65
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 63

def dic_settings
  @dic_settings
end

#dic_timesheetObject

Returns the value of attribute dic_timesheet.



65
66
67
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 65

def dic_timesheet
  @dic_timesheet
end

#fic_archiveObject

Returns the value of attribute fic_archive.



35
36
37
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 35

def fic_archive
  @fic_archive
end

#fic_calendarObject

Returns the value of attribute fic_calendar.



33
34
35
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 33

def fic_calendar
  @fic_calendar
end

#fic_cashbookObject

Returns the value of attribute fic_cashbook.



41
42
43
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 41

def fic_cashbook
  @fic_cashbook
end

#fic_clientsObject

Returns the value of attribute fic_clients.



21
22
23
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 21

def fic_clients
  @fic_clients
end

#fic_emailsObject

Returns the value of attribute fic_emails.



45
46
47
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 45

def fic_emails
  @fic_emails
end

#fic_exportObject

Returns the value of attribute fic_export.



47
48
49
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 47

def fic_export
  @fic_export
end

#fic_import_bankstatementsObject

Returns the value of attribute fic_import_bankstatements.



49
50
51
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 49

def fic_import_bankstatements
  @fic_import_bankstatements
end

#fic_import_clients_suppliersObject

Returns the value of attribute fic_import_clients_suppliers.



51
52
53
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 51

def fic_import_clients_suppliers
  @fic_import_clients_suppliers
end

#fic_import_issued_documentsObject

Returns the value of attribute fic_import_issued_documents.



53
54
55
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 53

def fic_import_issued_documents
  @fic_import_issued_documents
end

#fic_import_productsObject

Returns the value of attribute fic_import_products.



55
56
57
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 55

def fic_import_products
  @fic_import_products
end

#fic_issued_documentsObject

Returns the value of attribute fic_issued_documents.



27
28
29
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 27

def fic_issued_documents
  @fic_issued_documents
end

#fic_issued_documents_detailedObject

Returns the value of attribute fic_issued_documents_detailed.



67
68
69
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 67

def fic_issued_documents_detailed
  @fic_issued_documents_detailed
end

#fic_productsObject

Returns the value of attribute fic_products.



25
26
27
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 25

def fic_products
  @fic_products
end

#fic_receiptsObject

Returns the value of attribute fic_receipts.



31
32
33
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 31

def fic_receipts
  @fic_receipts
end

#fic_received_documentsObject

Returns the value of attribute fic_received_documents.



29
30
31
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 29

def fic_received_documents
  @fic_received_documents
end

#fic_recurringObject

Returns the value of attribute fic_recurring.



57
58
59
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 57

def fic_recurring
  @fic_recurring
end

#fic_ribaObject

Returns the value of attribute fic_riba.



59
60
61
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 59

def fic_riba
  @fic_riba
end

#fic_settingsObject

Returns the value of attribute fic_settings.



43
44
45
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 43

def fic_settings
  @fic_settings
end

#fic_situationObject

Returns the value of attribute fic_situation.



19
20
21
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 19

def fic_situation
  @fic_situation
end

#fic_stockObject

Returns the value of attribute fic_stock.



39
40
41
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 39

def fic_stock
  @fic_stock
end

#fic_suppliersObject

Returns the value of attribute fic_suppliers.



23
24
25
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 23

def fic_suppliers
  @fic_suppliers
end

#fic_taxesObject

Returns the value of attribute fic_taxes.



37
38
39
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 37

def fic_taxes
  @fic_taxes
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 367

def self._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
  when :Hash
    value
  else # model
    # models (e.g. Pet) or oneOf
    klass = FattureInCloud_Ruby_Sdk.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



123
124
125
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 123

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 92

def self.attribute_map
  {
    :'fic_situation' => :'fic_situation',
    :'fic_clients' => :'fic_clients',
    :'fic_suppliers' => :'fic_suppliers',
    :'fic_products' => :'fic_products',
    :'fic_issued_documents' => :'fic_issued_documents',
    :'fic_received_documents' => :'fic_received_documents',
    :'fic_receipts' => :'fic_receipts',
    :'fic_calendar' => :'fic_calendar',
    :'fic_archive' => :'fic_archive',
    :'fic_taxes' => :'fic_taxes',
    :'fic_stock' => :'fic_stock',
    :'fic_cashbook' => :'fic_cashbook',
    :'fic_settings' => :'fic_settings',
    :'fic_emails' => :'fic_emails',
    :'fic_export' => :'fic_export',
    :'fic_import_bankstatements' => :'fic_import_bankstatements',
    :'fic_import_clients_suppliers' => :'fic_import_clients_suppliers',
    :'fic_import_issued_documents' => :'fic_import_issued_documents',
    :'fic_import_products' => :'fic_import_products',
    :'fic_recurring' => :'fic_recurring',
    :'fic_riba' => :'fic_riba',
    :'dic_employees' => :'dic_employees',
    :'dic_settings' => :'dic_settings',
    :'dic_timesheet' => :'dic_timesheet',
    :'fic_issued_documents_detailed' => :'fic_issued_documents_detailed'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 343

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_nullableObject

List of attributes with nullable: true



159
160
161
162
163
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 159

def self.openapi_nullable
  Set.new([
    :'fic_issued_documents_detailed'
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 128

def self.openapi_types
  {
    :'fic_situation' => :'PermissionLevel',
    :'fic_clients' => :'PermissionLevel',
    :'fic_suppliers' => :'PermissionLevel',
    :'fic_products' => :'PermissionLevel',
    :'fic_issued_documents' => :'PermissionLevel',
    :'fic_received_documents' => :'PermissionLevel',
    :'fic_receipts' => :'PermissionLevel',
    :'fic_calendar' => :'PermissionLevel',
    :'fic_archive' => :'PermissionLevel',
    :'fic_taxes' => :'PermissionLevel',
    :'fic_stock' => :'PermissionLevel',
    :'fic_cashbook' => :'PermissionLevel',
    :'fic_settings' => :'PermissionLevel',
    :'fic_emails' => :'PermissionLevel',
    :'fic_export' => :'PermissionLevel',
    :'fic_import_bankstatements' => :'PermissionLevel',
    :'fic_import_clients_suppliers' => :'PermissionLevel',
    :'fic_import_issued_documents' => :'PermissionLevel',
    :'fic_import_products' => :'PermissionLevel',
    :'fic_recurring' => :'PermissionLevel',
    :'fic_riba' => :'PermissionLevel',
    :'dic_employees' => :'PermissionLevel',
    :'dic_settings' => :'PermissionLevel',
    :'dic_timesheet' => :'PermissionLevel',
    :'fic_issued_documents_detailed' => :'PermissionsFicIssuedDocumentsDetailed'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 298

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      fic_situation == o.fic_situation &&
      fic_clients == o.fic_clients &&
      fic_suppliers == o.fic_suppliers &&
      fic_products == o.fic_products &&
      fic_issued_documents == o.fic_issued_documents &&
      fic_received_documents == o.fic_received_documents &&
      fic_receipts == o.fic_receipts &&
      fic_calendar == o.fic_calendar &&
      fic_archive == o.fic_archive &&
      fic_taxes == o.fic_taxes &&
      fic_stock == o.fic_stock &&
      fic_cashbook == o.fic_cashbook &&
      fic_settings == o.fic_settings &&
      fic_emails == o.fic_emails &&
      fic_export == o.fic_export &&
      fic_import_bankstatements == o.fic_import_bankstatements &&
      fic_import_clients_suppliers == o.fic_import_clients_suppliers &&
      fic_import_issued_documents == o.fic_import_issued_documents &&
      fic_import_products == o.fic_import_products &&
      fic_recurring == o.fic_recurring &&
      fic_riba == o.fic_riba &&
      dic_employees == o.dic_employees &&
      dic_settings == o.dic_settings &&
      dic_timesheet == o.dic_timesheet &&
      fic_issued_documents_detailed == o.fic_issued_documents_detailed
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 440

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

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


330
331
332
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 330

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



336
337
338
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 336

def hash
  [fic_situation, fic_clients, fic_suppliers, fic_products, fic_issued_documents, fic_received_documents, fic_receipts, fic_calendar, fic_archive, fic_taxes, fic_stock, fic_cashbook, fic_settings, fic_emails, fic_export, fic_import_bankstatements, fic_import_clients_suppliers, fic_import_issued_documents, fic_import_products, fic_recurring, fic_riba, dic_employees, dic_settings, dic_timesheet, fic_issued_documents_detailed].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



283
284
285
286
287
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 283

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



416
417
418
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 416

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 422

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



410
411
412
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 410

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



291
292
293
294
# File 'lib/fattureincloud_ruby_sdk/models/permissions.rb', line 291

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end