lib/brevo/models/body_10.rb in brevo-2.0.0 vs lib/brevo/models/body_10.rb in brevo-3.0.0
- old
+ new
@@ -12,39 +12,69 @@
require 'date'
module Brevo
class Body10
- # visitor’s ID received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a> or generated by you to <a href=\"https://developers.brevo.com/docs/customize-the-widget#identifying-existing-users\">bind existing user account to Conversations</a>
- attr_accessor :visitor_id
+ # Name of task
+ attr_accessor :name
- # message text
- attr_accessor :text
+ # Duration of task in milliseconds [1 minute = 60000 ms]
+ attr_accessor :duration
- # agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>. Optional if `groupId` is set.
- attr_accessor :agent_id
+ # Id for type of task e.g Call / Email / Meeting etc.
+ attr_accessor :task_type_id
- # group ID. It can be found on group’s page. Optional if `agentId` is set.
- attr_accessor :group_id
+ # Task date/time
+ attr_accessor :date
+ # Notes added to a task
+ attr_accessor :notes
+
+ # Task marked as done
+ attr_accessor :done
+
+ # To assign a task to a user you can use either the account email or ID.
+ 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
+
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
- :'visitor_id' => :'visitorId',
- :'text' => :'text',
- :'agent_id' => :'agentId',
- :'group_id' => :'groupId'
+ :'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'
}
end
# Attribute type mapping.
def self.swagger_types
{
- :'visitor_id' => :'String',
- :'text' => :'String',
- :'agent_id' => :'String',
- :'group_id' => :'String'
+ :'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>'
}
end
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
@@ -52,59 +82,85 @@
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?(:'visitorId')
- self.visitor_id = attributes[:'visitorId']
+ if attributes.has_key?(:'name')
+ self.name = attributes[:'name']
end
- if attributes.has_key?(:'text')
- self.text = attributes[:'text']
+ if attributes.has_key?(:'duration')
+ self.duration = attributes[:'duration']
end
- if attributes.has_key?(:'agentId')
- self.agent_id = attributes[:'agentId']
+ if attributes.has_key?(:'taskTypeId')
+ self.task_type_id = attributes[:'taskTypeId']
end
- if attributes.has_key?(:'groupId')
- self.group_id = attributes[:'groupId']
+ 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
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 @visitor_id.nil?
- invalid_properties.push('invalid value for "visitor_id", visitor_id cannot be nil.')
- end
-
- if @text.nil?
- invalid_properties.push('invalid value for "text", text 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 @visitor_id.nil?
- return false if @text.nil?
true
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 &&
- visitor_id == o.visitor_id &&
- text == o.text &&
- agent_id == o.agent_id &&
- group_id == o.group_id
+ 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
end
# @see the `==` method
# @param [Object] Object to be compared
def eql?(o)
@@ -112,10 +168,10 @@
end
# Calculates hash code according to all attributes.
# @return [Fixnum] Hash code
def hash
- [visitor_id, text, agent_id, group_id].hash
+ [name, duration, task_type_id, date, notes, done, assign_to_id, contacts_ids, deals_ids, companies_ids].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself