class Podio::Integration

@see developers.podio.com/doc/integrations

Public Class Methods

create(app_id, attributes) click to toggle source

@see developers.podio.com/doc/integrations/create-integration-86839

# File lib/podio/models/integration.rb, line 47
def create(app_id, attributes)
  response = Podio.connection.post do |req|
    req.url "/integration/#{app_id}"
    req.body = {:type => attributes[:type], :silent => attributes[:silent], :config => attributes[:config]}
  end

  response.body['integration_id']
end
delete(app_id) click to toggle source

@see developers.podio.com/doc/integrations/delete-integration-86876

# File lib/podio/models/integration.rb, line 85
def delete(app_id)
  Podio.connection.delete("/integration/#{app_id}").status
end
find(app_id) click to toggle source

@see developers.podio.com/doc/integrations/get-integration-86821

# File lib/podio/models/integration.rb, line 75
def find(app_id)
  member Podio.connection.get("/integration/#{app_id}").body
end
find_available_fields_for(app_id) click to toggle source

@see developers.podio.com/doc/integrations/get-available-fields-86890

# File lib/podio/models/integration.rb, line 80
def find_available_fields_for(app_id)
  list Podio.connection.get("/integration/#{app_id}/field/").body
end
refresh(app_id) click to toggle source

@see developers.podio.com/doc/integrations/refresh-integration-86987

# File lib/podio/models/integration.rb, line 90
def refresh(app_id)
  Podio.connection.post("/integration/#{app_id}/refresh").status
end
update(app_id, attributes) click to toggle source

@see developers.podio.com/doc/integrations/update-integration-86843

# File lib/podio/models/integration.rb, line 57
def update(app_id, attributes)
  response = Podio.connection.put do |req|
    req.url "/integration/#{app_id}"
    req.body = {:silent => attributes[:silent], :config => attributes[:config]}
  end

  response.body
end
update_mapping(app_id, attributes) click to toggle source

@see developers.podio.com/doc/integrations/update-integration-mapping-86865

# File lib/podio/models/integration.rb, line 67
def update_mapping(app_id, attributes)
  response = Podio.connection.put do |req|
    req.url "/integration/#{app_id}/mapping"
    req.body = attributes[:mapping]
  end
end

Public Instance Methods

create() click to toggle source

@see developers.podio.com/doc/integrations/create-integration-86839

# File lib/podio/models/integration.rb, line 21
def create
  self.integration_id = Integration.create(self.app_id, attributes)
end
destroy() click to toggle source

@see developers.podio.com/doc/integrations/delete-integration-86876

# File lib/podio/models/integration.rb, line 36
def destroy
  Integration.delete(self.app_id)
end
refresh() click to toggle source

@see developers.podio.com/doc/integrations/refresh-integration-86987

# File lib/podio/models/integration.rb, line 41
def refresh
  Integration.refresh(self.app_id)
end
update() click to toggle source

@see developers.podio.com/doc/integrations/update-integration-86843

# File lib/podio/models/integration.rb, line 26
def update
  Integration.update(self.app_id, attributes)
end
update_mapping() click to toggle source

@see developers.podio.com/doc/integrations/update-integration-mapping-86865

# File lib/podio/models/integration.rb, line 31
def update_mapping
  Integration.update_mapping(self.app_id, attributes)
end