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.



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

def initialize
  clear
end

Instance Attribute Details

#display_nameObject

Returns the value of attribute display_name.



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

def display_name
  @display_name
end

#enabled_service_optionObject

Returns the value of attribute enabled_service_option.



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

def enabled_service_option
  @enabled_service_option
end

#has_licenseObject

Returns the value of attribute has_license.



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

def has_license
  @has_license
end

#idObject

Returns the value of attribute id.



16
17
18
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 16

def id
  @id
end

#job_titleObject

Returns the value of attribute job_title.



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

def job_title
  @job_title
end

#mailObject

Returns the value of attribute mail.



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

def mail
  @mail
end

#member_service_optionsObject

Returns the value of attribute member_service_options.



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

def member_service_options
  @member_service_options
end

#membersObject

Returns the value of attribute members.



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

def members
  @members
end

#service_optionsObject

Returns the value of attribute service_options.



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

def service_options
  @service_options
end

#site_idObject

Returns the value of attribute site_id.



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

def site_id
  @site_id
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

#unknown_json_fieldsObject

Returns the value of attribute unknown_json_fields.



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

def unknown_json_fields
  @unknown_json_fields
end

#user_principal_nameObject

Returns the value of attribute user_principal_name.



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

def user_principal_name
  @user_principal_name
end

#web_idObject

Returns the value of attribute web_id.



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

def web_id
  @web_id
end

#web_urlObject

Returns the value of attribute web_url.



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

def web_url
  @web_url
end

Instance Method Details

#clearObject



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

def clear
  @id = ''
  @type = 0
  @display_name = ''
  @mail = ''
  @job_title = ''
  @site_id = ''
  @web_id = ''
  @web_url = ''
  @user_principal_name = ''
  @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)


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
154
155
156
157
158
159
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 89

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 'UserPrincipalName'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @user_principal_name = 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)


82
83
84
85
86
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 82

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



211
212
213
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 211

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



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
200
201
202
203
204
205
206
207
208
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 162

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 @user_principal_name.nil?
    ret['UserPrincipalName'] = @user_principal_name
  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



216
217
218
# File 'lib/comet/models/office_365mixed_virtual_account.rb', line 216

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