Sha256: d24d99a9a3534a3a0487e53ba8431018da48b6408ff28828a8fc8edc0a789a49

Contents?: true

Size: 911 Bytes

Versions: 44

Compression:

Stored size: 911 Bytes

Contents

module Constituencies

  def get_constituencies(id, options={})
    options.merge!(basic_auth: @auth, headers: @headers)
    response = self.class.get(base_api_endpoint("CRM/Constituencies?constituentId=#{id}"), options)
    JSON.parse(response.body)
  end

  def get_constituent_snapshot(id, options={})
    options.merge!(basic_auth: @auth, headers: @headers)
    response = self.class.get(base_api_endpoint("CRM/Constituents/#{id}/Snapshot"), options)
    JSON.parse(response.body)
  end

  def create_constituencies(constituency, id, options={})
    parameters =
      {
          'ConstituencyType': {
              'Id': constituency
          },
          'Constituent': {
              'Id': id
          }
      }
    options.merge!(basic_auth: @auth, headers: @headers)
    options.merge!(:body => parameters)
    response = self.class.post(base_api_endpoint('CRM/Constituencies'), options)
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
tessitura_rest-0.8.1 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.8 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.7.9 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.7.8 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.7.7 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.7.6 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.7.5 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.7.4 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.7.3 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.7.2 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.7.1 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.7.0 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.6.9 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.6.8 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.6.7 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.6.6 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.6.5 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.6.4 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.6.3 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.6.2 lib/tessitura_rest/crm/constituencies.rb