Module: ContactAppointments

Included in:
ContactConfig
Defined in:
lib/contact/config/appointments.rb

Instance Method Summary collapse

Instance Method Details

#attach_follower(data) ⇒ Object

Attach Follower.

Attach follower to an appointment.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  appointment_id: 1,
  follower_ids: 1
}
@data = @mints_contact.attach_follower(data)


130
131
132
# File 'lib/contact/config/appointments.rb', line 130

def attach_follower(data)
  @client.raw('post', '/contacts/appointments/attach-follower', nil, data_transform(data))
end

#attach_invitee(data) ⇒ Object

Attach Invitee.

Attach invitee to an appointment.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  appointment_id: 1,
  invitee_ids: 1
}
@data = @mints_contact.attach_invitee(data)


113
114
115
# File 'lib/contact/config/appointments.rb', line 113

def attach_invitee(data)
  @client.raw('post', '/contacts/appointments/attach-invitee', nil, data_transform(data))
end

#create_appointment(data) ⇒ Object

Create Appointment.

Create an appointment with data.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  object_model: 'products',
  object_id: 1,
  title: 'New Appointment',
  start: '2021-11-25T14:15:00+00:00',
  end: '2022-01-01T13:00:00+00:00'
}
@data = @mints_contact.create_appointment(data)


60
61
62
# File 'lib/contact/config/appointments.rb', line 60

def create_appointment(data)
  @client.raw('post', '/contacts/appointments', nil, data_transform(data))
end

#detach_follower(data) ⇒ Object

Detach Follower.

Detach follower from an appointment.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  appointment_id: 1,
  follower_ids: 1
}
@data = @mints_contact.detach_follower(data)


164
165
166
# File 'lib/contact/config/appointments.rb', line 164

def detach_follower(data)
  @client.raw('post', '/contacts/appointments/detach-follower', nil, data_transform(data))
end

#detach_invitee(data) ⇒ Object

Detach Invitee.

Detach invitee from an appointment.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  appointment_id: 1,
  invitee_ids: 1
}
@data = @mints_contact.detach_invitee(data)


147
148
149
# File 'lib/contact/config/appointments.rb', line 147

def detach_invitee(data)
  @client.raw('post', '/contacts/appointments/detach-invitee', nil, data_transform(data))
end

#get_appointment(id, options = nil) ⇒ Object

Get Appointment.

Get an appointment info.

Parameters

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

First Example

@data = @mints_contact.get_appointment(1)

Second Example

options = {
  fields: 'id, created_at'
}
@data = @mints_contact.get_appointment(1, options)


40
41
42
# File 'lib/contact/config/appointments.rb', line 40

def get_appointment(id, options = nil)
  @client.raw('get', "/contacts/appointments/#{id}", options)
end

#get_appointments(options = nil) ⇒ Object

Get Appointments.

Get a collection of appointments.

Parameters

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

First Example

@data = @mints_contact.get_appointments

Second Example

options = {
  fields: 'id, created_at'
}
@data = @mints_contact.get_appointments(options)


21
22
23
# File 'lib/contact/config/appointments.rb', line 21

def get_appointments(options = nil)
  @client.raw('get', '/contacts/appointments', options)
end

#scheduled_appointments(data) ⇒ Object

Scheduled Appointments.

Get a collection of appointments filtering by object_type, object_id and dates range.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  object_model: 'products',
  object_id: 2,
  start: '2021-11-25T14:15:00+00:00',
  end: '2022-01-01T13:00:00+00:00'
}
@data = @mints_contact.scheduled_appointments(data)


96
97
98
# File 'lib/contact/config/appointments.rb', line 96

def scheduled_appointments(data)
  @client.raw('post', '/contacts/appointments/scheduled-appointments', nil, data_transform(data))
end

#sync_follower(data) ⇒ Object

Sync Follower.

Sync a follower from an appointment.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  appointment_id: 1,
  follower_ids: 1
}
@data = @mints_contact.sync_follower(data)


198
199
200
# File 'lib/contact/config/appointments.rb', line 198

def sync_follower(data)
  @client.raw('post', '/contacts/appointments/sync-follower', nil, data_transform(data))
end

#sync_invitee(data) ⇒ Object

Sync Invitee.

Sync an invitee from an appointment.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  appointment_id: 1,
  invitee_ids: 1
}
@data = @mints_contact.sync_invitee(data)


181
182
183
# File 'lib/contact/config/appointments.rb', line 181

def sync_invitee(data)
  @client.raw('post', '/contacts/appointments/sync-invitee', nil, data_transform(data))
end

#update_appointment(id, data) ⇒ Object

Update Appointment.

Update an appointment info.

Parameters

id

(Integer) – Appointment id.

data

(Hash) – Data to be submitted.

Example

data = {
  object_id: 2
}
@data = @mints_contact.update_appointment(1, data)


77
78
79
# File 'lib/contact/config/appointments.rb', line 77

def update_appointment(id, data)
  @client.raw('put', "/contacts/appointments/#{id}", nil, data_transform(data))
end