class OSDNClient::UserStats

Attributes

bzr_count[RW]
chamber_file_count[RW]
chamber_vcs_count[RW]
cvs_count[RW]
date[RW]
forum_count[RW]
forum_misc_count[RW]
ghosted_approve_count[RW]
ghosted_submit_count[RW]
git_count[RW]
group_approved_count[RW]
group_history_count[RW]
hg_count[RW]
news_count[RW]
project_review_rating_submit_count[RW]
project_review_submit_count[RW]
project_review_update_count[RW]
svn_count[RW]
ticket_close_count[RW]
ticket_comment_count[RW]
ticket_milestone_count[RW]
ticket_misc_count[RW]
ticket_open_count[RW]
ticket_owner_count[RW]
user_point[RW]
wiki_count[RW]

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/osdn-client/models/user_stats.rb, line 83
def self.attribute_map
  {
    :'date' => :'date',
    :'user_point' => :'user_point',
    :'news_count' => :'news_count',
    :'git_count' => :'git_count',
    :'svn_count' => :'svn_count',
    :'hg_count' => :'hg_count',
    :'bzr_count' => :'bzr_count',
    :'cvs_count' => :'cvs_count',
    :'wiki_count' => :'wiki_count',
    :'forum_count' => :'forum_count',
    :'forum_misc_count' => :'forum_misc_count',
    :'ticket_open_count' => :'ticket_open_count',
    :'ticket_close_count' => :'ticket_close_count',
    :'ticket_comment_count' => :'ticket_comment_count',
    :'ticket_owner_count' => :'ticket_owner_count',
    :'ticket_misc_count' => :'ticket_misc_count',
    :'ticket_milestone_count' => :'ticket_milestone_count',
    :'group_approved_count' => :'group_approved_count',
    :'group_history_count' => :'group_history_count',
    :'ghosted_submit_count' => :'ghosted_submit_count',
    :'ghosted_approve_count' => :'ghosted_approve_count',
    :'project_review_submit_count' => :'project_review_submit_count',
    :'project_review_update_count' => :'project_review_update_count',
    :'project_review_rating_submit_count' => :'project_review_rating_submit_count',
    :'chamber_file_count' => :'chamber_file_count',
    :'chamber_vcs_count' => :'chamber_vcs_count'
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/osdn-client/models/user_stats.rb, line 148
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'date')
    self.date = attributes[:'date']
  end

  if attributes.has_key?(:'user_point')
    self.user_point = attributes[:'user_point']
  end

  if attributes.has_key?(:'news_count')
    self.news_count = attributes[:'news_count']
  end

  if attributes.has_key?(:'git_count')
    self.git_count = attributes[:'git_count']
  end

  if attributes.has_key?(:'svn_count')
    self.svn_count = attributes[:'svn_count']
  end

  if attributes.has_key?(:'hg_count')
    self.hg_count = attributes[:'hg_count']
  end

  if attributes.has_key?(:'bzr_count')
    self.bzr_count = attributes[:'bzr_count']
  end

  if attributes.has_key?(:'cvs_count')
    self.cvs_count = attributes[:'cvs_count']
  end

  if attributes.has_key?(:'wiki_count')
    self.wiki_count = attributes[:'wiki_count']
  end

  if attributes.has_key?(:'forum_count')
    self.forum_count = attributes[:'forum_count']
  end

  if attributes.has_key?(:'forum_misc_count')
    self.forum_misc_count = attributes[:'forum_misc_count']
  end

  if attributes.has_key?(:'ticket_open_count')
    self.ticket_open_count = attributes[:'ticket_open_count']
  end

  if attributes.has_key?(:'ticket_close_count')
    self.ticket_close_count = attributes[:'ticket_close_count']
  end

  if attributes.has_key?(:'ticket_comment_count')
    self.ticket_comment_count = attributes[:'ticket_comment_count']
  end

  if attributes.has_key?(:'ticket_owner_count')
    self.ticket_owner_count = attributes[:'ticket_owner_count']
  end

  if attributes.has_key?(:'ticket_misc_count')
    self.ticket_misc_count = attributes[:'ticket_misc_count']
  end

  if attributes.has_key?(:'ticket_milestone_count')
    self.ticket_milestone_count = attributes[:'ticket_milestone_count']
  end

  if attributes.has_key?(:'group_approved_count')
    self.group_approved_count = attributes[:'group_approved_count']
  end

  if attributes.has_key?(:'group_history_count')
    self.group_history_count = attributes[:'group_history_count']
  end

  if attributes.has_key?(:'ghosted_submit_count')
    self.ghosted_submit_count = attributes[:'ghosted_submit_count']
  end

  if attributes.has_key?(:'ghosted_approve_count')
    self.ghosted_approve_count = attributes[:'ghosted_approve_count']
  end

  if attributes.has_key?(:'project_review_submit_count')
    self.project_review_submit_count = attributes[:'project_review_submit_count']
  end

  if attributes.has_key?(:'project_review_update_count')
    self.project_review_update_count = attributes[:'project_review_update_count']
  end

  if attributes.has_key?(:'project_review_rating_submit_count')
    self.project_review_rating_submit_count = attributes[:'project_review_rating_submit_count']
  end

  if attributes.has_key?(:'chamber_file_count')
    self.chamber_file_count = attributes[:'chamber_file_count']
  end

  if attributes.has_key?(:'chamber_vcs_count')
    self.chamber_vcs_count = attributes[:'chamber_vcs_count']
  end

end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/osdn-client/models/user_stats.rb, line 115
def self.swagger_types
  {
    :'date' => :'String',
    :'user_point' => :'Integer',
    :'news_count' => :'Integer',
    :'git_count' => :'Integer',
    :'svn_count' => :'Integer',
    :'hg_count' => :'Integer',
    :'bzr_count' => :'Integer',
    :'cvs_count' => :'Integer',
    :'wiki_count' => :'Integer',
    :'forum_count' => :'Integer',
    :'forum_misc_count' => :'Integer',
    :'ticket_open_count' => :'Integer',
    :'ticket_close_count' => :'Integer',
    :'ticket_comment_count' => :'Integer',
    :'ticket_owner_count' => :'Integer',
    :'ticket_misc_count' => :'Integer',
    :'ticket_milestone_count' => :'Integer',
    :'group_approved_count' => :'Integer',
    :'group_history_count' => :'Integer',
    :'ghosted_submit_count' => :'Integer',
    :'ghosted_approve_count' => :'Integer',
    :'project_review_submit_count' => :'Integer',
    :'project_review_update_count' => :'Integer',
    :'project_review_rating_submit_count' => :'Integer',
    :'chamber_file_count' => :'Integer',
    :'chamber_vcs_count' => :'Integer'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/osdn-client/models/user_stats.rb, line 275
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      date == o.date &&
      user_point == o.user_point &&
      news_count == o.news_count &&
      git_count == o.git_count &&
      svn_count == o.svn_count &&
      hg_count == o.hg_count &&
      bzr_count == o.bzr_count &&
      cvs_count == o.cvs_count &&
      wiki_count == o.wiki_count &&
      forum_count == o.forum_count &&
      forum_misc_count == o.forum_misc_count &&
      ticket_open_count == o.ticket_open_count &&
      ticket_close_count == o.ticket_close_count &&
      ticket_comment_count == o.ticket_comment_count &&
      ticket_owner_count == o.ticket_owner_count &&
      ticket_misc_count == o.ticket_misc_count &&
      ticket_milestone_count == o.ticket_milestone_count &&
      group_approved_count == o.group_approved_count &&
      group_history_count == o.group_history_count &&
      ghosted_submit_count == o.ghosted_submit_count &&
      ghosted_approve_count == o.ghosted_approve_count &&
      project_review_submit_count == o.project_review_submit_count &&
      project_review_update_count == o.project_review_update_count &&
      project_review_rating_submit_count == o.project_review_rating_submit_count &&
      chamber_file_count == o.chamber_file_count &&
      chamber_vcs_count == o.chamber_vcs_count
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/osdn-client/models/user_stats.rb, line 342
def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /^(true|t|yes|y|1)$/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = OSDNClient.const_get(type).new
    temp_model.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/osdn-client/models/user_stats.rb, line 408
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/osdn-client/models/user_stats.rb, line 321
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/osdn-client/models/user_stats.rb, line 308
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/osdn-client/models/user_stats.rb, line 314
def hash
  [date, user_point, news_count, git_count, svn_count, hg_count, bzr_count, cvs_count, wiki_count, forum_count, forum_misc_count, ticket_open_count, ticket_close_count, ticket_comment_count, ticket_owner_count, ticket_misc_count, ticket_milestone_count, group_approved_count, group_history_count, ghosted_submit_count, ghosted_approve_count, project_review_submit_count, project_review_update_count, project_review_rating_submit_count, chamber_file_count, chamber_vcs_count].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properies with the reasons

# File lib/osdn-client/models/user_stats.rb, line 262
def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/osdn-client/models/user_stats.rb, line 388
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/osdn-client/models/user_stats.rb, line 394
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/osdn-client/models/user_stats.rb, line 382
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/osdn-client/models/user_stats.rb, line 269
def valid?
  return true
end