コード例 #1
0
    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)
コード例 #2
0
    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))
コード例 #3
0
    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))
コード例 #4
0
    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))
コード例 #5
0
    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))
コード例 #6
0
    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))
コード例 #7
0
    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)
コード例 #8
0
    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)
コード例 #9
0
    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)
コード例 #10
0
    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)
コード例 #11
0
    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)
コード例 #12
0
    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")
コード例 #13
0
    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)
コード例 #14
0
    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)
コード例 #15
0
    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)
コード例 #16
0
    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)
コード例 #17
0
    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)
コード例 #18
0
    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")
コード例 #19
0
    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)
コード例 #20
0
 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")