def update_program_member(self, program_id, member_id, customer_number, first_name, last_name, email=nil): if program_id is None: raise MissingArgumentException("Please provide a program_id") if member_id is None: raise MissingArgumentException("Please provide a") if customer_number is None: raise MissingArgumentException("Please provide a customer_number") if first_name is None: raise MissingArgumentException("Please provide a first_name") if last_name is None: raise MissingArgumentException("Please provide a last_name") options = { 'customer_number': customer_number, 'first_name': first_name, 'last_name': last_name, 'email': email } return self.put( "programs/" + str(program_id) + "/members/" + str(member_id), options)
def delete_campaign_beacon(self, campaign_id, beacon_id): if campaign_id is None: raise MissingArgumentException('Please provide a campaign_id') if beacon_id is None: raise MissingArgumentException('Please provide a beacon_id') return self.delete("campaigns/" + str(campaign_id) + "/ibeacons/" + str(beacon_id))
def delete_program_beacon(self, program_id, beacon_id): if program_id is None: raise MissingArgumentException("Please provide a program_id") if beacon_id is None: raise MissingArgumentException("Please provide a beacon_id") return self.delete("/programs/" + str(program_id) + "/ibeacons/" + str(beacon_id))
def delete_program_backfield(self, program_id, backfield_id): if program_id is None: raise MissingArgumentException("Please provide a program_id") if backfield_id is None: raise MissingArgumentException("Please provide a backfield_id") return self.delete("/programs/" + str(program_id) + "/backfields/" + str(backfield_id))
def delete_program_member(self, program_id, member_id): if program_id is None: raise MissingArgumentException("Please provide a program_id") if member_id is None: raise MissingArgumentException("Please provide a") return self.delete("programs/" + str(program_id) + "/members/" + str(member_id))
def delete_program_location(self, program_id, location_id): if program_id is None: raise MissingArgumentException("Please provide a program_id") if location_id is None: raise MissingArgumentException("Please provide a location_id") return self.delete("programs/" + str(program_id) + "/locations/" + str(location_id))
def create_program_backfield(self, program_id, title, description): if program_id is None: raise MissingArgumentException("Please provide a program_id") options = {title: title, description: description} return self.post("programs/" + str(program_id) + "/backfields", options)
def create_program_member(self, program_id, customer_number, first_name, last_name): if program_id is None: raise MissingArgumentException("Please provide a program_id") if customer_number is None: raise MissingArgumentException("Please provide a customer_number") if first_name is None: raise MissingArgumentException("Please provide a first_name") if last_name is None: raise MissingArgumentException("Please provide a last_name") options = { 'customer_number': customer_number, 'first_name': first_name, 'last_name': last_name } return self.post("programs/" + str(pogram_id) + "/members", options)
def create_program_location(self, program_id, lat, long, name, relevant_text, address=''): if program_id is None: raise MissingArgumentException("Please provide a program_id") options = { 'program_id': program_id, 'lat': lat, 'long': long, 'name': name, 'address': address, 'relevant_text': relevant_text } return self.post("programs/" + str(program_id) + "/locations", options)
def create_program_beacon(self, program_id, proximity_uuid, relevant_text, major=None, minor=None): if program_id is None: raise MissingArgumentException("Please provide a program_id") options = { 'program_id': program_id, 'proximity_uuid': proximity_uuid, 'relevant_text': relevant_text } if major is not None: options['major'] = major if minor is not None: options['minor'] = minor return self.post("programs/" + str(program_id) + "/ibeacons", options)
def create_campaign_beacon(self, campaign_id, proximity_uuid, relevant_text, major=None, minor=None): if campaign_id is None: raise MissingArgumentException('Please provide a campaign_id') options = { 'campaign_id': campaign_id, 'proximity_uuid': proximity_uuid, 'relevant_text': relevant_text } if major is not None: options['major'] = major if minor is not None: options['minor'] = minor return self.post("campaigns/" + str(campaign_id) + "/ibeacons", options)
def get_program_beacons(self, program_id): if program_id is None: raise MissingArgumentException("Please provide a program_id") return self.get("/programs/" + program_id + "/ibeacons")
def update_campaign(self, campaign_id, options={}): if campaign_id is None: raise MissingArgumentException('Please provide a campaign_id') return self.put("campaigns/" + campaign_id, options)
def push_program(self, program_id, options={}): if program_id is None: raise MissingArgumentException("Please provide a program_id") return self.post("programs/" + str(program_id) + "/push_message", options)
def update_program(self, program_id, options={}): if program_id is None: raise MissingArgumentException("Please provide a program_id") return self.put("programs/" + str(campaign_id), options)
def create_pass(self, campaign_id, options={}): if campaign_id is None: raise MissingArgumentException('Please provide a campaign_id') options['campaign_id'] = campaign_id return self.post("passes", options)
def update_template(self, template_id, options={}): if template_id is None: raise MissingArgumentException('Please provide a template_id') return self.put("tempates/" + template_id, options)
def get_program_backfields(self, program_id): if program_id is None: raise MissingArgumentException("Please provide a program_id") return self.get("programs/ " + str(program_id) + " /backfields")
def update_pass(self, pass_id, options={}): if pass_id is None: raise MissingArgumentException('Please provide a pass_id') return self.put("passes/" + str(pass_id), options)
def get_campaign_beacons(self, campaign_id): if campaign_id is None: raise MissingArgumentException('Please provide a campaign_id') return self.get("campaigns/" + str(campaign_id) + "/ibeacons")