class Pipedrive::BaseDeal

Attributes

active[RW]

If the Deal is activated or not

activities_count[RW]

The number of Activities associated with the Deal

add_time[RW]

The creation date and time of the Deal

cc_email[RW]

The Cc email of the Deal

close_time[RW]

The date and time of closing the Deal

currency[RW]

The currency associated with the Deal

deleted[RW]

If the Deal is deleted or not

done_activities_count[RW]

The number of completed Activities associated with the Deal

email_messages_count[RW]

The number of emails associated with the Deal

expected_close_date[RW]

The expected close date and time of the Deal

files_count[RW]

The number of Files associated with the Deal

first_won_time[RW]

The date and time of the first time changing the Deal status as won

followers_count[RW]

The number of Followers associated with the Deal

formatted_value[RW]

The Deal value formatted with selected currency. E.g. US$500

formatted_weighted_value[RW]

The weighted_value formatted with selected currency. E.g. US$500

label[RW]

The label assigned to the Deal

last_activity_date[RW]

The date of the last activity associated with the Deal

last_activity_id[RW]

The ID of the last activity associated with the Deal

last_incoming_mail_time[RW]

The date and time of the last incoming email associated with the Deal

last_outgoing_mail_time[RW]

The date and time of the last outgoing email associated with the Deal

lost_reason[RW]

The reason for losing the Deal

lost_time[RW]

The date and time of changing the Deal status as lost

next_activity_date[RW]

The date of the next activity associated with the Deal

next_activity_duration[RW]

The duration of the next activity associated with the Deal

next_activity_id[RW]

The ID of the next activity associated with the Deal

next_activity_note[RW]

The note of the next activity associated with the Deal

next_activity_subject[RW]

The subject of the next activity associated with the Deal

next_activity_time[RW]

The time of the next activity associated with the Deal

next_activity_type[RW]

The type of the next activity associated with the Deal

notes_count[RW]

The number of Notes associated with the Deal

org_hidden[RW]

If the Organization that is associated with the Deal is hidden or not

org_name[RW]

The name of the Organization associated with the Deal

owner_name[RW]

The name of the Deal owner

participants_count[RW]

The number of Participants associated with the Deal

person_hidden[RW]

If the Person that is associated with the Deal is hidden or not

person_name[RW]

The name of the Person associated with the Deal

pipeline_id[RW]

The ID of pipeline associated with the Deal

probability[RW]

The success probability percentage of the Deal

products_count[RW]

The number of Products associated with the Deal

rotten_time[RW]

The date and time of changing the Deal status as rotten

stage_change_time[RW]

The last updated date and time of the Deal stage

stage_id[RW]

The ID of the Deal stage

stage_order_nr[RW]

The order number of the Deal stage associated with the Deal

status[RW]

The status of the Deal

title[RW]

The title of the Deal

undone_activities_count[RW]

The number of incomplete Activities associated with the Deal

update_time[RW]

The last updated date and time of the Deal

value[RW]

The value of the Deal

visible_to[RW]

The visibility of the Deal

weighted_value[RW]

Probability times Deal value. Probability can either be Deal probability or if not set, then stage probability.

weighted_value_currency[RW]

The currency associated with the Deal

won_time[RW]

The date and time of changing the Deal status as won

Public Class Methods

attribute_map() click to toggle source

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

# File lib/pipedrive-openapi-client/models/base_deal.rb, line 174
def self.attribute_map
  {
    :'stage_id' => :'stage_id',
    :'title' => :'title',
    :'value' => :'value',
    :'currency' => :'currency',
    :'add_time' => :'add_time',
    :'update_time' => :'update_time',
    :'stage_change_time' => :'stage_change_time',
    :'active' => :'active',
    :'deleted' => :'deleted',
    :'status' => :'status',
    :'probability' => :'probability',
    :'next_activity_date' => :'next_activity_date',
    :'next_activity_time' => :'next_activity_time',
    :'next_activity_id' => :'next_activity_id',
    :'last_activity_id' => :'last_activity_id',
    :'last_activity_date' => :'last_activity_date',
    :'lost_reason' => :'lost_reason',
    :'visible_to' => :'visible_to',
    :'close_time' => :'close_time',
    :'pipeline_id' => :'pipeline_id',
    :'won_time' => :'won_time',
    :'first_won_time' => :'first_won_time',
    :'lost_time' => :'lost_time',
    :'products_count' => :'products_count',
    :'files_count' => :'files_count',
    :'notes_count' => :'notes_count',
    :'followers_count' => :'followers_count',
    :'email_messages_count' => :'email_messages_count',
    :'activities_count' => :'activities_count',
    :'done_activities_count' => :'done_activities_count',
    :'undone_activities_count' => :'undone_activities_count',
    :'participants_count' => :'participants_count',
    :'expected_close_date' => :'expected_close_date',
    :'last_incoming_mail_time' => :'last_incoming_mail_time',
    :'last_outgoing_mail_time' => :'last_outgoing_mail_time',
    :'label' => :'label',
    :'stage_order_nr' => :'stage_order_nr',
    :'person_name' => :'person_name',
    :'org_name' => :'org_name',
    :'next_activity_subject' => :'next_activity_subject',
    :'next_activity_type' => :'next_activity_type',
    :'next_activity_duration' => :'next_activity_duration',
    :'next_activity_note' => :'next_activity_note',
    :'formatted_value' => :'formatted_value',
    :'weighted_value' => :'weighted_value',
    :'formatted_weighted_value' => :'formatted_weighted_value',
    :'weighted_value_currency' => :'weighted_value_currency',
    :'rotten_time' => :'rotten_time',
    :'owner_name' => :'owner_name',
    :'cc_email' => :'cc_email',
    :'org_hidden' => :'org_hidden',
    :'person_hidden' => :'person_hidden'
  }
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/pipedrive-openapi-client/models/base_deal.rb, line 613
def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end
new(attributes = {}) click to toggle source

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

# File lib/pipedrive-openapi-client/models/base_deal.rb, line 304
def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Pipedrive::BaseDeal` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Pipedrive::BaseDeal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'stage_id')
    self.stage_id = attributes[:'stage_id']
  end

  if attributes.key?(:'title')
    self.title = attributes[:'title']
  end

  if attributes.key?(:'value')
    self.value = attributes[:'value']
  end

  if attributes.key?(:'currency')
    self.currency = attributes[:'currency']
  end

  if attributes.key?(:'add_time')
    self.add_time = attributes[:'add_time']
  end

  if attributes.key?(:'update_time')
    self.update_time = attributes[:'update_time']
  end

  if attributes.key?(:'stage_change_time')
    self.stage_change_time = attributes[:'stage_change_time']
  end

  if attributes.key?(:'active')
    self.active = attributes[:'active']
  end

  if attributes.key?(:'deleted')
    self.deleted = attributes[:'deleted']
  end

  if attributes.key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.key?(:'probability')
    self.probability = attributes[:'probability']
  end

  if attributes.key?(:'next_activity_date')
    self.next_activity_date = attributes[:'next_activity_date']
  end

  if attributes.key?(:'next_activity_time')
    self.next_activity_time = attributes[:'next_activity_time']
  end

  if attributes.key?(:'next_activity_id')
    self.next_activity_id = attributes[:'next_activity_id']
  end

  if attributes.key?(:'last_activity_id')
    self.last_activity_id = attributes[:'last_activity_id']
  end

  if attributes.key?(:'last_activity_date')
    self.last_activity_date = attributes[:'last_activity_date']
  end

  if attributes.key?(:'lost_reason')
    self.lost_reason = attributes[:'lost_reason']
  end

  if attributes.key?(:'visible_to')
    self.visible_to = attributes[:'visible_to']
  end

  if attributes.key?(:'close_time')
    self.close_time = attributes[:'close_time']
  end

  if attributes.key?(:'pipeline_id')
    self.pipeline_id = attributes[:'pipeline_id']
  end

  if attributes.key?(:'won_time')
    self.won_time = attributes[:'won_time']
  end

  if attributes.key?(:'first_won_time')
    self.first_won_time = attributes[:'first_won_time']
  end

  if attributes.key?(:'lost_time')
    self.lost_time = attributes[:'lost_time']
  end

  if attributes.key?(:'products_count')
    self.products_count = attributes[:'products_count']
  end

  if attributes.key?(:'files_count')
    self.files_count = attributes[:'files_count']
  end

  if attributes.key?(:'notes_count')
    self.notes_count = attributes[:'notes_count']
  end

  if attributes.key?(:'followers_count')
    self.followers_count = attributes[:'followers_count']
  end

  if attributes.key?(:'email_messages_count')
    self.email_messages_count = attributes[:'email_messages_count']
  end

  if attributes.key?(:'activities_count')
    self.activities_count = attributes[:'activities_count']
  end

  if attributes.key?(:'done_activities_count')
    self.done_activities_count = attributes[:'done_activities_count']
  end

  if attributes.key?(:'undone_activities_count')
    self.undone_activities_count = attributes[:'undone_activities_count']
  end

  if attributes.key?(:'participants_count')
    self.participants_count = attributes[:'participants_count']
  end

  if attributes.key?(:'expected_close_date')
    self.expected_close_date = attributes[:'expected_close_date']
  end

  if attributes.key?(:'last_incoming_mail_time')
    self.last_incoming_mail_time = attributes[:'last_incoming_mail_time']
  end

  if attributes.key?(:'last_outgoing_mail_time')
    self.last_outgoing_mail_time = attributes[:'last_outgoing_mail_time']
  end

  if attributes.key?(:'label')
    self.label = attributes[:'label']
  end

  if attributes.key?(:'stage_order_nr')
    self.stage_order_nr = attributes[:'stage_order_nr']
  end

  if attributes.key?(:'person_name')
    self.person_name = attributes[:'person_name']
  end

  if attributes.key?(:'org_name')
    self.org_name = attributes[:'org_name']
  end

  if attributes.key?(:'next_activity_subject')
    self.next_activity_subject = attributes[:'next_activity_subject']
  end

  if attributes.key?(:'next_activity_type')
    self.next_activity_type = attributes[:'next_activity_type']
  end

  if attributes.key?(:'next_activity_duration')
    self.next_activity_duration = attributes[:'next_activity_duration']
  end

  if attributes.key?(:'next_activity_note')
    self.next_activity_note = attributes[:'next_activity_note']
  end

  if attributes.key?(:'formatted_value')
    self.formatted_value = attributes[:'formatted_value']
  end

  if attributes.key?(:'weighted_value')
    self.weighted_value = attributes[:'weighted_value']
  end

  if attributes.key?(:'formatted_weighted_value')
    self.formatted_weighted_value = attributes[:'formatted_weighted_value']
  end

  if attributes.key?(:'weighted_value_currency')
    self.weighted_value_currency = attributes[:'weighted_value_currency']
  end

  if attributes.key?(:'rotten_time')
    self.rotten_time = attributes[:'rotten_time']
  end

  if attributes.key?(:'owner_name')
    self.owner_name = attributes[:'owner_name']
  end

  if attributes.key?(:'cc_email')
    self.cc_email = attributes[:'cc_email']
  end

  if attributes.key?(:'org_hidden')
    self.org_hidden = attributes[:'org_hidden']
  end

  if attributes.key?(:'person_hidden')
    self.person_hidden = attributes[:'person_hidden']
  end
end
openapi_nullable() click to toggle source

List of attributes with nullable: true

# File lib/pipedrive-openapi-client/models/base_deal.rb, line 290
def self.openapi_nullable
  Set.new([
    :'probability',
    :'next_activity_id',
    :'last_activity_id',
    :'last_activity_date',
    :'lost_reason',
    :'close_time',
    :'rotten_time',
  ])
end
openapi_types() click to toggle source

Attribute type mapping.

# File lib/pipedrive-openapi-client/models/base_deal.rb, line 232
def self.openapi_types
  {
    :'stage_id' => :'Integer',
    :'title' => :'String',
    :'value' => :'Float',
    :'currency' => :'String',
    :'add_time' => :'String',
    :'update_time' => :'String',
    :'stage_change_time' => :'String',
    :'active' => :'Boolean',
    :'deleted' => :'Boolean',
    :'status' => :'String',
    :'probability' => :'Float',
    :'next_activity_date' => :'String',
    :'next_activity_time' => :'String',
    :'next_activity_id' => :'Integer',
    :'last_activity_id' => :'Integer',
    :'last_activity_date' => :'String',
    :'lost_reason' => :'String',
    :'visible_to' => :'String',
    :'close_time' => :'String',
    :'pipeline_id' => :'Integer',
    :'won_time' => :'String',
    :'first_won_time' => :'String',
    :'lost_time' => :'String',
    :'products_count' => :'Integer',
    :'files_count' => :'Integer',
    :'notes_count' => :'Integer',
    :'followers_count' => :'Integer',
    :'email_messages_count' => :'Integer',
    :'activities_count' => :'Integer',
    :'done_activities_count' => :'Integer',
    :'undone_activities_count' => :'Integer',
    :'participants_count' => :'Integer',
    :'expected_close_date' => :'String',
    :'last_incoming_mail_time' => :'String',
    :'last_outgoing_mail_time' => :'String',
    :'label' => :'String',
    :'stage_order_nr' => :'Integer',
    :'person_name' => :'String',
    :'org_name' => :'String',
    :'next_activity_subject' => :'String',
    :'next_activity_type' => :'String',
    :'next_activity_duration' => :'String',
    :'next_activity_note' => :'String',
    :'formatted_value' => :'String',
    :'weighted_value' => :'Float',
    :'formatted_weighted_value' => :'String',
    :'weighted_value_currency' => :'String',
    :'rotten_time' => :'String',
    :'owner_name' => :'String',
    :'cc_email' => :'String',
    :'org_hidden' => :'Boolean',
    :'person_hidden' => :'Boolean'
  }
end

Public Instance Methods

==(o) click to toggle source

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

# File lib/pipedrive-openapi-client/models/base_deal.rb, line 541
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      stage_id == o.stage_id &&
      title == o.title &&
      value == o.value &&
      currency == o.currency &&
      add_time == o.add_time &&
      update_time == o.update_time &&
      stage_change_time == o.stage_change_time &&
      active == o.active &&
      deleted == o.deleted &&
      status == o.status &&
      probability == o.probability &&
      next_activity_date == o.next_activity_date &&
      next_activity_time == o.next_activity_time &&
      next_activity_id == o.next_activity_id &&
      last_activity_id == o.last_activity_id &&
      last_activity_date == o.last_activity_date &&
      lost_reason == o.lost_reason &&
      visible_to == o.visible_to &&
      close_time == o.close_time &&
      pipeline_id == o.pipeline_id &&
      won_time == o.won_time &&
      first_won_time == o.first_won_time &&
      lost_time == o.lost_time &&
      products_count == o.products_count &&
      files_count == o.files_count &&
      notes_count == o.notes_count &&
      followers_count == o.followers_count &&
      email_messages_count == o.email_messages_count &&
      activities_count == o.activities_count &&
      done_activities_count == o.done_activities_count &&
      undone_activities_count == o.undone_activities_count &&
      participants_count == o.participants_count &&
      expected_close_date == o.expected_close_date &&
      last_incoming_mail_time == o.last_incoming_mail_time &&
      last_outgoing_mail_time == o.last_outgoing_mail_time &&
      label == o.label &&
      stage_order_nr == o.stage_order_nr &&
      person_name == o.person_name &&
      org_name == o.org_name &&
      next_activity_subject == o.next_activity_subject &&
      next_activity_type == o.next_activity_type &&
      next_activity_duration == o.next_activity_duration &&
      next_activity_note == o.next_activity_note &&
      formatted_value == o.formatted_value &&
      weighted_value == o.weighted_value &&
      formatted_weighted_value == o.formatted_weighted_value &&
      weighted_value_currency == o.weighted_value_currency &&
      rotten_time == o.rotten_time &&
      owner_name == o.owner_name &&
      cc_email == o.cc_email &&
      org_hidden == o.org_hidden &&
      person_hidden == o.person_hidden
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/pipedrive-openapi-client/models/base_deal.rb, line 641
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 =~ /\A(true|t|yes|y|1)\z/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
    Pipedrive.const_get(type).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/pipedrive-openapi-client/models/base_deal.rb, line 710
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/pipedrive-openapi-client/models/base_deal.rb, line 620
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that 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/pipedrive-openapi-client/models/base_deal.rb, line 600
def eql?(o)
  self == o
end
hash() click to toggle source

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

# File lib/pipedrive-openapi-client/models/base_deal.rb, line 606
def hash
  [stage_id, title, value, currency, add_time, update_time, stage_change_time, active, deleted, status, probability, next_activity_date, next_activity_time, next_activity_id, last_activity_id, last_activity_date, lost_reason, visible_to, close_time, pipeline_id, won_time, first_won_time, lost_time, products_count, files_count, notes_count, followers_count, email_messages_count, activities_count, done_activities_count, undone_activities_count, participants_count, expected_close_date, last_incoming_mail_time, last_outgoing_mail_time, label, stage_order_nr, person_name, org_name, next_activity_subject, next_activity_type, next_activity_duration, next_activity_note, formatted_value, weighted_value, formatted_weighted_value, weighted_value_currency, rotten_time, owner_name, cc_email, org_hidden, person_hidden].hash
end
list_invalid_properties() click to toggle source

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

# File lib/pipedrive-openapi-client/models/base_deal.rb, line 528
def list_invalid_properties
  invalid_properties = Array.new
  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/pipedrive-openapi-client/models/base_deal.rb, line 686
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/pipedrive-openapi-client/models/base_deal.rb, line 692
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end
    
    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/pipedrive-openapi-client/models/base_deal.rb, line 680
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/pipedrive-openapi-client/models/base_deal.rb, line 535
def valid?
  true
end