class Comet::Organization
Organization is a typed class wrapper around the underlying Comet Server API data structure.
def clear
def clear @audit_file_options = {} @branding = Comet::BrandingOptions.new @constellation_role = Comet::ConstellationRoleOptions.new @email = Comet::EmailOptions.new @experimental_options = [] @hosts = [] @name = '' @psaconfigs = [] @remote_storage = [] @software_build_role = Comet::SoftwareBuildRoleOptions.new @webhook_options = {} @unknown_json_fields = {} end
def from_hash(obj)
-
obj
(Hash
) -- The complete object as a Ruby hash
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 'AuditFileOptions' @audit_file_options = {} if v.nil? @audit_file_options = {} else v.each do |k1, v1| @audit_file_options[k1] = Comet::FileOption.new @audit_file_options[k1].from_hash(v1) end end when 'Branding' @branding = Comet::BrandingOptions.new @branding.from_hash(v) when 'ConstellationRole' @constellation_role = Comet::ConstellationRoleOptions.new @constellation_role.from_hash(v) when 'Email' @email = Comet::EmailOptions.new @email.from_hash(v) when 'ExperimentalOptions' if v.nil? @experimental_options = [] else @experimental_options = Array.new(v.length) v.each_with_index do |v1, i1| raise TypeError, "'v1' expected String, got #{v1.class}" unless v1.is_a? String @experimental_options[i1] = v1 end end when 'Hosts' if v.nil? @hosts = [] else @hosts = Array.new(v.length) v.each_with_index do |v1, i1| raise TypeError, "'v1' expected String, got #{v1.class}" unless v1.is_a? String @hosts[i1] = v1 end end when 'Name' raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String @name = v when 'IsSuspended' @is_suspended = v when 'PSAConfigs' if v.nil? @psaconfigs = [] else @psaconfigs = Array.new(v.length) v.each_with_index do |v1, i1| @psaconfigs[i1] = Comet::PSAConfig.new @psaconfigs[i1].from_hash(v1) end end when 'RemoteStorage' if v.nil? @remote_storage = [] else @remote_storage = Array.new(v.length) v.each_with_index do |v1, i1| @remote_storage[i1] = Comet::RemoteStorageOption.new @remote_storage[i1].from_hash(v1) end end when 'SoftwareBuildRole' @software_build_role = Comet::SoftwareBuildRoleOptions.new @software_build_role.from_hash(v) when 'WebhookOptions' @webhook_options = {} if v.nil? @webhook_options = {} else v.each do |k1, v1| @webhook_options[k1] = Comet::WebhookOption.new @webhook_options[k1].from_hash(v1) end end else @unknown_json_fields[k] = v end end end
def from_json(json_string)
-
json_string
(String
) -- The complete object in JSON format
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
def initialize
def initialize clear end
def to_h
-
(Hash)
- The complete object as a Ruby hash
def to_h to_hash end
def to_hash
-
(Hash)
- The complete object as a Ruby hash
def to_hash ret = {} ret['AuditFileOptions'] = @audit_file_options ret['Branding'] = @branding ret['ConstellationRole'] = @constellation_role ret['Email'] = @email unless @experimental_options.nil? ret['ExperimentalOptions'] = @experimental_options end ret['Hosts'] = @hosts ret['Name'] = @name ret['IsSuspended'] = @is_suspended ret['PSAConfigs'] = @psaconfigs ret['RemoteStorage'] = @remote_storage ret['SoftwareBuildRole'] = @software_build_role ret['WebhookOptions'] = @webhook_options @unknown_json_fields.each do |k, v| ret[k] = v end ret end
def to_json(options = {})
-
(String)
- The complete object as a JSON string
def to_json(options = {}) to_hash.to_json(options) end