Module: WorkflowStepObjects

Included in:
CRM
Defined in:
lib/user/crm/workflow_step_objects.rb

Instance Method Summary collapse

Instance Method Details

#create_step_object(data) ⇒ Object

Create workflow step object.

Create a workflow step object with data.

Parameters

data

(Hash) – Data to be submitted.

Example

data = {
  "objectType": "deals",
  "stepId": 9,
  "objectId": 1
}
@data = @mints_user.create_step_object(data)

52
53
54
# File 'lib/user/crm/workflow_step_objects.rb', line 52

def create_step_object(data)
    @client.raw("post", "/crm/step-objects/", nil, data_transform(data))
end

#get_step_object(id, options = nil) ⇒ Object

Get workflow step object.

Get a workflow step object info.

Parameters

id

(Integer) – Workflow step object id.

options

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

First Example

@data = @mints_user.get_step_object(1)

Second Example

options = { "fields": "id, step_id" }
@data = @mints_user.get_step_object(1, options)

35
36
37
# File 'lib/user/crm/workflow_step_objects.rb', line 35

def get_step_object(id, options = nil)
    @client.raw("get", "/crm/step-objects/#{id}", options)
end

#get_step_object_by_object_type(objectType, objectId, options = nil) ⇒ Object

Get workflow step object by object type.

Get a workflow step object info by an object type.

Parameters

objectType

(String) – Object type.

objectId

(Integer) – Workflow step object id.

options

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

First Example

@data = @mints_user.get_step_object_by_object_type("deals", 1)

Second Example

options = { "fields": "id, object_id" }
@data = @mints_user.get_step_object_by_object_type("deals", 1, options)

86
87
88
# File 'lib/user/crm/workflow_step_objects.rb', line 86

def get_step_object_by_object_type(objectType, objectId, options = nil)
    @client.raw("get", "/crm/step-objects/#{objectType}/#{objectId}", options)
end

#get_step_objects(options = nil) ⇒ Object

Get workflow step objects.

Get a collection of workflow step objects.

Parameters

options

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

First Example

@data = @mints_user.get_step_objects

Second Example

options = { "fields": "id" }
@data = @mints_user.get_step_objects(options)

18
19
20
# File 'lib/user/crm/workflow_step_objects.rb', line 18

def get_step_objects(options = nil)
    @client.raw("get", "/crm/step-objects", options)
end

#update_step_object(id, data) ⇒ Object

Update workflow step object.

Update a workflow step object info.

Parameters

id

(Integer) – Workflow step object id.

data

(Hash) – Data to be submitted.

Example

data = {
  "stepId": 10
}
@data = @mints_user.update_step_object(128, data.to_json)

68
69
70
# File 'lib/user/crm/workflow_step_objects.rb', line 68

def update_step_object(id, data)
    @client.raw("put", "/crm/step-objects/#{id}", nil, data)
end