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.4.3 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.4.2 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.4.1 lib/tessitura_rest/crm/constituencies.rb
tessitura_rest-0.4.0 lib/tessitura_rest/crm/constituencies.rb