lib/brevo/models/body_6.rb in brevo-2.0.0 vs lib/brevo/models/body_6.rb in brevo-3.0.0
- old
+ new
@@ -12,73 +12,29 @@
require 'date'
module Brevo
class Body6
- # Name of task
+ # Name of deal
attr_accessor :name
- # Duration of task in milliseconds [1 minute = 60000 ms]
- attr_accessor :duration
+ # Attributes for deal creation To assign owner of a Deal you can send attributes.deal_owner and utilize the account email or ID. If you want to create a deal on a specific pipeline and stage you can use the following attributes `pipeline` and `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}`
+ attr_accessor :attributes
- # Id for type of task e.g Call / Email / Meeting etc.
- attr_accessor :task_type_id
-
- # Task due date and time
- attr_accessor :date
-
- # Notes added to a task
- attr_accessor :notes
-
- # Task marked as done
- attr_accessor :done
-
- # User id to whom task is assigned
- attr_accessor :assign_to_id
-
- # Contact ids for contacts linked to this task
- attr_accessor :contacts_ids
-
- # Deal ids for deals a task is linked to
- attr_accessor :deals_ids
-
- # Companies ids for companies a task is linked to
- attr_accessor :companies_ids
-
- attr_accessor :reminder
-
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'name' => :'name',
- :'duration' => :'duration',
- :'task_type_id' => :'taskTypeId',
- :'date' => :'date',
- :'notes' => :'notes',
- :'done' => :'done',
- :'assign_to_id' => :'assignToId',
- :'contacts_ids' => :'contactsIds',
- :'deals_ids' => :'dealsIds',
- :'companies_ids' => :'companiesIds',
- :'reminder' => :'reminder'
+ :'attributes' => :'attributes'
}
end
# Attribute type mapping.
def self.swagger_types
{
:'name' => :'String',
- :'duration' => :'Integer',
- :'task_type_id' => :'String',
- :'date' => :'DateTime',
- :'notes' => :'String',
- :'done' => :'BOOLEAN',
- :'assign_to_id' => :'String',
- :'contacts_ids' => :'Array<Integer>',
- :'deals_ids' => :'Array<String>',
- :'companies_ids' => :'Array<String>',
- :'reminder' => :'TaskReminder'
+ :'attributes' => :'Object'
}
end
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
@@ -90,116 +46,40 @@
if attributes.has_key?(:'name')
self.name = attributes[:'name']
end
- if attributes.has_key?(:'duration')
- self.duration = attributes[:'duration']
+ if attributes.has_key?(:'attributes')
+ self.attributes = attributes[:'attributes']
end
-
- if attributes.has_key?(:'taskTypeId')
- self.task_type_id = attributes[:'taskTypeId']
- end
-
- if attributes.has_key?(:'date')
- self.date = attributes[:'date']
- end
-
- if attributes.has_key?(:'notes')
- self.notes = attributes[:'notes']
- end
-
- if attributes.has_key?(:'done')
- self.done = attributes[:'done']
- end
-
- if attributes.has_key?(:'assignToId')
- self.assign_to_id = attributes[:'assignToId']
- end
-
- if attributes.has_key?(:'contactsIds')
- if (value = attributes[:'contactsIds']).is_a?(Array)
- self.contacts_ids = value
- end
- end
-
- if attributes.has_key?(:'dealsIds')
- if (value = attributes[:'dealsIds']).is_a?(Array)
- self.deals_ids = value
- end
- end
-
- if attributes.has_key?(:'companiesIds')
- if (value = attributes[:'companiesIds']).is_a?(Array)
- self.companies_ids = value
- end
- end
-
- if attributes.has_key?(:'reminder')
- self.reminder = attributes[:'reminder']
- end
end
# Show invalid properties with the reasons. Usually used together with valid?
# @return Array for valid properties with the reasons
def list_invalid_properties
invalid_properties = Array.new
if @name.nil?
invalid_properties.push('invalid value for "name", name cannot be nil.')
end
- if !@duration.nil? && @duration < 0
- invalid_properties.push('invalid value for "duration", must be greater than or equal to 0.')
- end
-
- if @task_type_id.nil?
- invalid_properties.push('invalid value for "task_type_id", task_type_id cannot be nil.')
- end
-
- if @date.nil?
- invalid_properties.push('invalid value for "date", date cannot be nil.')
- end
-
invalid_properties
end
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
return false if @name.nil?
- return false if !@duration.nil? && @duration < 0
- return false if @task_type_id.nil?
- return false if @date.nil?
true
end
- # Custom attribute writer method with validation
- # @param [Object] duration Value to be assigned
- def duration=(duration)
- if !duration.nil? && duration < 0
- fail ArgumentError, 'invalid value for "duration", must be greater than or equal to 0.'
- end
-
- @duration = duration
- end
-
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
name == o.name &&
- duration == o.duration &&
- task_type_id == o.task_type_id &&
- date == o.date &&
- notes == o.notes &&
- done == o.done &&
- assign_to_id == o.assign_to_id &&
- contacts_ids == o.contacts_ids &&
- deals_ids == o.deals_ids &&
- companies_ids == o.companies_ids &&
- reminder == o.reminder
+ attributes == o.attributes
end
# @see the `==` method
# @param [Object] Object to be compared
def eql?(o)
@@ -207,10 +87,10 @@
end
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
- [name, duration, task_type_id, date, notes, done, assign_to_id, contacts_ids, deals_ids, companies_ids, reminder].hash
+ [name, attributes].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself