labpack/events/meetup.py
def join_topics(self, member_id, topics):

        ''' a method to add topics to member profile details on meetup

        :param member_id: integer with member id from member profile
        :param topics: list of integer meetup ids for topics
        :return: dictionary with list of topic details inside [json] key

        topic_details = self.objects.topic.schema
        '''

    # https://www.meetup.com/meetup_api/docs/members/:member_id/#edit

        title = '%s.join_topics' % self.__class__.__name__

    # validate permissions
        if not 'profile_edit' in self.service_scope:
            raise ValueError('%s requires group_join as part of oauth2 service_scope permissions.' % title)

    # validate inputs
        input_fields = {
            'member_id': member_id,
            'topics': topics
        }
        for key, value in input_fields.items():
            if value:
                object_title = '%s(%s=%s)' % (title, key, str(value))
                self.fields.validate(value, '.%s' % key, object_title)

    # construct request fields
        url = '%s/members/%s' % (self.endpoint, member_id)
        params = {
            'add_topics': ','.join(str(x) for x in topics),
            'fields': 'topics'
        }

    # send requests
        response_details = self._patch_request(url, params=params)

    # construct method output dictionary
        member_topics = {
            'json': []
        }
        for key, value in response_details.items():
            if not key == 'json':
                member_topics[key] = value

    # parse response
        if response_details['json']:
            if 'topics' in response_details['json'].keys():
                for topic in response_details['json']['topics']:
                    member_topics['json'].append(self.objects.topic.ingest(**topic))

        return member_topics
 a method to add topics to member profile details on meetup

        :param member_id: integer with member id from member profile
        :param topics: list of integer meetup ids for topics
        :return: dictionary with list of topic details inside [json] key

        topic_details = self.objects.topic.schema
        
a method to add topics to member profile details on meetup
a method to add topics to member profile details on meetup
def join_topics(self, member_id, topics):
        title = '%s.join_topics' % self.__class__.__name__
        if not 'profile_edit' in self.service_scope:
            raise ValueError('%s requires group_join as part of oauth2 service_scope permissions.' % title)
        input_fields = {
            'member_id': member_id,
            'topics': topics
        }
        for key, value in input_fields.items():
            if value:
                object_title = '%s(%s=%s)' % (title, key, str(value))
                self.fields.validate(value, '.%s' % key, object_title)
        url = '%s/members/%s' % (self.endpoint, member_id)
        params = {
            'add_topics': ','.join(str(x) for x in topics),
            'fields': 'topics'
        }
        response_details = self._patch_request(url, params=params)
        member_topics = {
            'json': []
        }
        for key, value in response_details.items():
            if not key == 'json':
                member_topics[key] = value
        if response_details['json']:
            if 'topics' in response_details['json'].keys():
                for topic in response_details['json']['topics']:
                    member_topics['json'].append(self.objects.topic.ingest(**topic))
        return member_topics
def join_topics ( self , member_id , topics ) : title = '%s.join_topics' % self . __class__ . __name__ if not 'profile_edit' in self . service_scope : raise ValueError ( '%s requires group_join as part of oauth2 service_scope permissions.' % title ) input_fields = { 'member_id' : member_id , 'topics' : topics } for key , value in input_fields . items ( ) : if value : object_title = '%s(%s=%s)' % ( title , key , str ( value ) ) self . fields . validate ( value , '.%s' % key , object_title ) url = '%s/members/%s' % ( self . endpoint , member_id ) params = { 'add_topics' : ',' . join ( str ( x ) for x in topics ) , 'fields' : 'topics' } response_details = self . _patch_request ( url , params = params ) member_topics = { 'json' : [ ] } for key , value in response_details . items ( ) : if not key == 'json' : member_topics [ key ] = value if response_details [ 'json' ] : if 'topics' in response_details [ 'json' ] . keys ( ) : for topic in response_details [ 'json' ] [ 'topics' ] : member_topics [ 'json' ] . append ( self . objects . topic . ingest ( ** topic ) ) return member_topics
a method to add topics to member profile details on meetup
a method to add topics to member profile details on meetup
''' a method to add topics to member profile details on meetup

        :param member_id: integer with member id from member profile
        :param topics: list of integer meetup ids for topics
        :return: dictionary with list of topic details inside [json] key

        topic_details = self.objects.topic.schema
        ''' # https://www.meetup.com/meetup_api/docs/members/:member_id/#edit
 # validate permissions
 # validate inputs
 # construct request fields
 # send requests
 # construct method output dictionary
 # parse response

dictionary with list of topic details inside [json] key
topic_details = self.objects.topic.schema
dictionary with list of topic details inside [ json ] key topic_details = self . objects . topic . schema
self
member_id
integer with member id from member profile
integer with member id from member profile
topics
list of integer meetup ids for topics
list of integer meetup ids for topics