Class: DataSift::ManagedSourceResource

Inherits:
ApiResource show all
Defined in:
lib/managed_source_resource.rb

Overview

Methods for using Auth specific Managed Sources API endpoints

Constant Summary

Constants inherited from ApiResource

ApiResource::TLSv1, ApiResource::TLSv1_2

Constants included from DataSift

APPLICATION_JSON, DELETE, DETECT_DEAD_SOCKETS, GET, HEAD, IS_WINDOWS, KNOWN_SOCKETS, SOCKET_DETECTOR_TIMEOUT, VERSION, X_ANALYSIS_TASKS_QUEUED, X_ANALYSIS_TASKS_QUEUE_LIMIT, X_INSIGHT_TASKS_QUEUED, X_INSIGHT_TASKS_QUEUE_LIMIT, X_RATELIMIT_COST, X_RATELIMIT_LIMIT, X_RATELIMIT_REMAINING, X_TASKS_QUEUED, X_TASKS_QUEUE_LIMIT

Instance Method Summary collapse

Methods inherited from ApiResource

#initialize, #requires

Methods included from DataSift

#build_path, request

Constructor Details

This class inherits a constructor from DataSift::ApiResource

Instance Method Details

#add(id, resources, validate = 'true') ⇒ Object

Add resources to a Managed Source

Parameters:

  • id (String)

    ID of the Managed Source you are adding resources to

  • resources (Array)

    Array of resources you are adding to your source

  • validate (Boolean) (defaults to: 'true')

    Whether you want to validate your new resources against the third party API (i.e. the Facebook or Instagram API)



10
11
12
13
14
15
16
17
18
# File 'lib/managed_source_resource.rb', line 10

def add(id, resources, validate = 'true')
  params = {
    id: id,
    resources: resources,
    validate: validate
  }
  requires params
  DataSift.request(:PUT, 'source/resource/add', @config, params)
end

#remove(id, resource_ids) ⇒ Object

Remove resources from a Managed Source

Parameters:

  • id (String)

    ID of the Managed Source you are removing resources from

  • resource_ids (Array)

    Array of resource_id strings you need to remove from your source



26
27
28
29
30
31
32
33
# File 'lib/managed_source_resource.rb', line 26

def remove(id, resource_ids)
  params = {
    id: id,
    resource_ids: resource_ids
  }
  requires params
  DataSift.request(:PUT, 'source/resource/remove', @config, params)
end