class Comet::Office365CustomSetting

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

Attributes

mailbox_group_ids[RW]

@type [Array<String>] mailbox_group_ids

mailbox_strategy[RW]

@type [String] mailbox_strategy

mailbox_user_ids[RW]

@type [Array<String>] mailbox_user_ids

site_ids[RW]

@type [Array<String>] site_ids

site_strategy[RW]

@type [String] site_strategy

unknown_json_fields[RW]

@type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations

Public Class Methods

new() click to toggle source
# File lib/comet/models/office_365custom_setting.rb, line 35
def initialize
  clear
end

Public Instance Methods

clear() click to toggle source
# File lib/comet/models/office_365custom_setting.rb, line 39
def clear
  @mailbox_strategy = ''
  @site_strategy = ''
  @mailbox_user_ids = []
  @mailbox_group_ids = []
  @site_ids = []
  @unknown_json_fields = {}
end
from_hash(obj) click to toggle source

@param [Hash] obj The complete object as a Ruby hash

# File lib/comet/models/office_365custom_setting.rb, line 56
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 'MailboxStrategy'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

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

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

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

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

          @site_ids[i1] = v1
        end
      end
    else
      @unknown_json_fields[k] = v
    end
  end
end
from_json(json_string) click to toggle source

@param [String] json_string The complete object in JSON format

# File lib/comet/models/office_365custom_setting.rb, line 49
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_h() click to toggle source

@return [Hash] The complete object as a Ruby hash

# File lib/comet/models/office_365custom_setting.rb, line 123
def to_h
  to_hash
end
to_hash() click to toggle source

@return [Hash] The complete object as a Ruby hash

# File lib/comet/models/office_365custom_setting.rb, line 109
def to_hash
  ret = {}
  ret['MailboxStrategy'] = @mailbox_strategy
  ret['SiteStrategy'] = @site_strategy
  ret['MailboxUserIDs'] = @mailbox_user_ids
  ret['MailboxGroupIDs'] = @mailbox_group_ids
  ret['SiteIDs'] = @site_ids
  @unknown_json_fields.each do |k, v|
    ret[k] = v
  end
  ret
end
to_json(options = {}) click to toggle source

@return [String] The complete object as a JSON string

# File lib/comet/models/office_365custom_setting.rb, line 128
def to_json(options = {})
  to_hash.to_json(options)
end