Class: Comet::Office365MixedVirtualAccount

Inherits:
Object
  • Object
show all
Defined in:
lib/comet/models/office_365mixed_virtual_account.rb

Overview

Office365MixedVirtualAccount is a typed class wrapper around the underlying Comet Server API data structure.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOffice365MixedVirtualAccount

Returns a new instance of Office365MixedVirtualAccount.



59
60
61
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 59

def initialize
  clear
end

Instance Attribute Details

#display_nameObject

Returns the value of attribute display_name.



24
25
26
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 24

def display_name
  @display_name
end

#enabled_service_optionObject

Returns the value of attribute enabled_service_option.



42
43
44
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 42

def enabled_service_option
  @enabled_service_option
end

#has_licenseObject

Returns the value of attribute has_license.



54
55
56
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 54

def has_license
  @has_license
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 18

def id
  @id
end

#job_titleObject

Returns the value of attribute job_title.



30
31
32
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 30

def job_title
  @job_title
end

#mailObject

Returns the value of attribute mail.



27
28
29
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 27

def mail
  @mail
end

#member_service_optionsObject

Returns the value of attribute member_service_options.



51
52
53
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 51

def member_service_options
  @member_service_options
end

#membersObject

Returns the value of attribute members.



45
46
47
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 45

def members
  @members
end

#service_optionsObject

Returns the value of attribute service_options.



48
49
50
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 48

def service_options
  @service_options
end

#site_idObject

Returns the value of attribute site_id.



33
34
35
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 33

def site_id
  @site_id
end

#typeObject

Returns the value of attribute type.



21
22
23
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 21

def type
  @type
end

#unknown_json_fieldsObject

Returns the value of attribute unknown_json_fields.



57
58
59
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 57

def unknown_json_fields
  @unknown_json_fields
end

#web_idObject

Returns the value of attribute web_id.



36
37
38
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 36

def web_id
  @web_id
end

#web_urlObject

Returns the value of attribute web_url.



39
40
41
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 39

def web_url
  @web_url
end

Instance Method Details

#clearObject



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 63

def clear
  @id = ''
  @type = 0
  @display_name = ''
  @mail = ''
  @job_title = ''
  @site_id = ''
  @web_id = ''
  @web_url = ''
  @enabled_service_option = 0
  @members = []
  @service_options = 0
  @member_service_options = 0
  @unknown_json_fields = {}
end

#from_hash(obj) ⇒ Object

Parameters:

  • obj (Hash)

    The complete object as a Ruby hash

Raises:

  • (TypeError)


87
88
89
90
91
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
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
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 87

def from_hash(obj)
  raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash

  obj.each do |k, v|
    case k
    when 'id'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @id = v
    when 'Type'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @type = v
    when 'DisplayName'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @display_name = v
    when 'Mail'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @mail = v
    when 'JobTitle'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @job_title = v
    when 'SiteID'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @site_id = v
    when 'WebID'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @web_id = v
    when 'WebURL'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @web_url = v
    when 'EnabledServiceOption'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @enabled_service_option = v
    when 'Members'
      if v.nil?
        @members = []
      else
        @members = Array.new(v.length)
        v.each_with_index do |v1, i1|
          raise TypeError, "'v1' expected String, got #{v1.class}" unless v1.is_a? String

          @members[i1] = v1
        end
      end
    when 'ServiceOptions'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @service_options = v
    when 'MemberServiceOptions'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @member_service_options = v
    when 'hasLicense'
      @has_license = v
    else
      @unknown_json_fields[k] = v
    end
  end
end

#from_json(json_string) ⇒ Object

Parameters:

  • json_string (String)

    The complete object in JSON format

Raises:

  • (TypeError)


80
81
82
83
84
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 80

def from_json(json_string)
  raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String

  from_hash(JSON.parse(json_string))
end

#to_hHash

Returns The complete object as a Ruby hash.

Returns:

  • (Hash)

    The complete object as a Ruby hash



202
203
204
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 202

def to_h
  to_hash
end

#to_hashHash

Returns The complete object as a Ruby hash.

Returns:

  • (Hash)

    The complete object as a Ruby hash



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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 156

def to_hash
  ret = {}
  ret['id'] = @id
  unless @type.nil?
    ret['Type'] = @type
  end
  unless @display_name.nil?
    ret['DisplayName'] = @display_name
  end
  unless @mail.nil?
    ret['Mail'] = @mail
  end
  unless @job_title.nil?
    ret['JobTitle'] = @job_title
  end
  unless @site_id.nil?
    ret['SiteID'] = @site_id
  end
  unless @web_id.nil?
    ret['WebID'] = @web_id
  end
  unless @web_url.nil?
    ret['WebURL'] = @web_url
  end
  unless @enabled_service_option.nil?
    ret['EnabledServiceOption'] = @enabled_service_option
  end
  unless @members.nil?
    ret['Members'] = @members
  end
  unless @service_options.nil?
    ret['ServiceOptions'] = @service_options
  end
  unless @member_service_options.nil?
    ret['MemberServiceOptions'] = @member_service_options
  end
  unless @has_license.nil?
    ret['hasLicense'] = @has_license
  end
  @unknown_json_fields.each do |k, v|
    ret[k] = v
  end
  ret
end

#to_json(options = {}) ⇒ String

Returns The complete object as a JSON string.

Returns:

  • (String)

    The complete object as a JSON string



207
208
209
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 207

def to_json(options = {})
  to_hash.to_json(options)
end