Class: MistApi::TemplateApplies

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/template_applies.rb

Overview

Where this template should be applied to, can be org_id, site_ids, sitegroup_ids

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(org_id = SKIP, site_ids = SKIP, sitegroup_ids = SKIP) ⇒ TemplateApplies

Returns a new instance of TemplateApplies.



48
49
50
51
52
# File 'lib/mist_api/models/template_applies.rb', line 48

def initialize(org_id = SKIP, site_ids = SKIP, sitegroup_ids = SKIP)
  @org_id = org_id unless org_id == SKIP
  @site_ids = site_ids unless site_ids == SKIP
  @sitegroup_ids = sitegroup_ids unless sitegroup_ids == SKIP
end

Instance Attribute Details

#org_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


15
16
17
# File 'lib/mist_api/models/template_applies.rb', line 15

def org_id
  @org_id
end

#site_idsArray[UUID | String]

List of site ids

Returns:

  • (Array[UUID | String])


19
20
21
# File 'lib/mist_api/models/template_applies.rb', line 19

def site_ids
  @site_ids
end

#sitegroup_idsArray[UUID | String]

List of sitegroup ids

Returns:

  • (Array[UUID | String])


23
24
25
# File 'lib/mist_api/models/template_applies.rb', line 23

def sitegroup_ids
  @sitegroup_ids
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/mist_api/models/template_applies.rb', line 55

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  site_ids = hash.key?('site_ids') ? hash['site_ids'] : SKIP
  sitegroup_ids = hash.key?('sitegroup_ids') ? hash['sitegroup_ids'] : SKIP

  # Create object from extracted values.
  TemplateApplies.new(org_id,
                      site_ids,
                      sitegroup_ids)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/mist_api/models/template_applies.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['org_id'] = 'org_id'
  @_hash['site_ids'] = 'site_ids'
  @_hash['sitegroup_ids'] = 'sitegroup_ids'
  @_hash
end

.nullablesObject

An array for nullable fields



44
45
46
# File 'lib/mist_api/models/template_applies.rb', line 44

def self.nullables
  []
end

.optionalsObject

An array for optional fields



35
36
37
38
39
40
41
# File 'lib/mist_api/models/template_applies.rb', line 35

def self.optionals
  %w[
    org_id
    site_ids
    sitegroup_ids
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



77
78
79
80
81
# File 'lib/mist_api/models/template_applies.rb', line 77

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} org_id: #{@org_id.inspect}, site_ids: #{@site_ids.inspect}, sitegroup_ids:"\
  " #{@sitegroup_ids.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



70
71
72
73
74
# File 'lib/mist_api/models/template_applies.rb', line 70

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} org_id: #{@org_id}, site_ids: #{@site_ids}, sitegroup_ids:"\
  " #{@sitegroup_ids}>"
end