class Pipedrive::BaseDeal
Attributes
If the Deal is activated or not
The number of Activities associated with the Deal
The creation date and time of the Deal
The Cc email of the Deal
The date and time of closing the Deal
The currency associated with the Deal
If the Deal is deleted or not
The number of completed Activities associated with the Deal
The number of emails associated with the Deal
The expected close date and time of the Deal
The number of Files associated with the Deal
The date and time of the first time changing the Deal status as won
The number of Followers associated with the Deal
The Deal value formatted with selected currency. E.g. US$500
The weighted_value
formatted with selected currency. E.g. US$500
The label assigned to the Deal
The date of the last activity associated with the Deal
The ID of the last activity associated with the Deal
The date and time of the last incoming email associated with the Deal
The date and time of the last outgoing email associated with the Deal
The reason for losing the Deal
The date and time of changing the Deal status as lost
The date of the next activity associated with the Deal
The duration of the next activity associated with the Deal
The ID of the next activity associated with the Deal
The note of the next activity associated with the Deal
The subject of the next activity associated with the Deal
The time of the next activity associated with the Deal
The type of the next activity associated with the Deal
The number of Notes associated with the Deal
The name of the Organization associated with the Deal
The name of the Deal owner
The number of Participants associated with the Deal
The name of the Person associated with the Deal
The ID of pipeline associated with the Deal
The success probability percentage of the Deal
The number of Products associated with the Deal
The date and time of changing the Deal status as rotten
The last updated date and time of the Deal stage
The ID of the Deal stage
The order number of the Deal stage associated with the Deal
The status of the Deal
The title of the Deal
The number of incomplete Activities associated with the Deal
The last updated date and time of the Deal
The value of the Deal
The visibility of the Deal
Probability times Deal value. Probability can either be Deal probability or if not set, then stage probability.
The currency associated with the Deal
The date and time of changing the Deal status as won
Public Class Methods
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
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
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
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
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
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
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
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
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
@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
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
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
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
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
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