Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create_conference (self, series_id, slug, title, user_id, cfp_lead_text=None, cfp_post_submit_instructions=None, cfp_pre_submit_instructions=None, contact_information=None, description=None, sub_title=None, timezone=None, **args):
try:
payload = {}
hdrs = {}
if series_id is None:
raise MissingRequiredArgument('property series_id must be provided')
payload['series_id'] = series_id
if slug is None:
raise MissingRequiredArgument('property slug must be provided')
payload['slug'] = slug
if title is None:
raise MissingRequiredArgument('property title must be provided')
payload['title'] = title
if user_id is None:
raise MissingRequiredArgument('property user_id must be provided')
payload['user_id'] = user_id
if cfp_lead_text is not None:
payload['cfp_lead_text'] = cfp_lead_text
if cfp_post_submit_instructions is not None:
payload['cfp_post_submit_instructions'] = cfp_post_submit_instructions
if cfp_pre_submit_instructions is not None:
payload['cfp_pre_submit_instructions'] = cfp_pre_submit_instructions
if contact_information is not None:
payload['contact_information'] = contact_information
if description is not None:
payload['description'] = description
if series_id is not None:
payload['series_id'] = series_id
if slug is not None:
payload['slug'] = slug
if sub_title is not None:
raise MissingRequiredArgument('property overall_rating must be provided')
payload['overall_rating'] = overall_rating
if session_id is None:
raise MissingRequiredArgument('property session_id must be provided')
payload['session_id'] = session_id
if speaker_knowledge is None:
raise MissingRequiredArgument('property speaker_knowledge must be provided')
payload['speaker_knowledge'] = speaker_knowledge
if speaker_presentation is None:
raise MissingRequiredArgument('property speaker_presentation must be provided')
payload['speaker_presentation'] = speaker_presentation
if user_id is None:
raise MissingRequiredArgument('property user_id must be provided')
payload['user_id'] = user_id
if user_prior_knowledge is None:
raise MissingRequiredArgument('property user_prior_knowledge must be provided')
payload['user_prior_knowledge'] = user_prior_knowledge
if comment_good is not None:
payload['comment_good'] = comment_good
if comment_improvement is not None:
payload['comment_improvement'] = comment_improvement
if material_quality is not None:
payload['material_quality'] = material_quality
if overall_rating is not None:
payload['overall_rating'] = overall_rating
if session_id is not None:
payload['session_id'] = session_id
if speaker_knowledge is not None:
payload['speaker_knowledge'] = speaker_knowledge
if speaker_presentation is not None:
payload['speaker_presentation'] = speaker_presentation
if user_id is not None:
def list_external_resource (self, conference_id, user_id, lang=None, limit=None, since=None):
try:
payload = {}
hdrs = {}
if conference_id is None:
raise MissingRequiredArgument('property conference_id must be provided')
payload['conference_id'] = conference_id
if user_id is None:
raise MissingRequiredArgument('property user_id must be provided')
payload['user_id'] = user_id
if conference_id is not None:
payload['conference_id'] = conference_id
if lang is not None:
payload['lang'] = lang
if limit is not None:
payload['limit'] = limit
if since is not None:
payload['since'] = since
uri = '%s/v1/external_resource/list' % self.endpoint
qs = urlencode(payload, True)
if self.debug:
print('GET %s?%s' % (uri, qs))
def list_conference_date (self, conference_id, user_id):
try:
payload = {}
hdrs = {}
if conference_id is None:
raise MissingRequiredArgument('property conference_id must be provided')
payload['conference_id'] = conference_id
if user_id is None:
raise MissingRequiredArgument('property user_id must be provided')
payload['user_id'] = user_id
if conference_id is not None:
payload['conference_id'] = conference_id
if user_id is not None:
payload['user_id'] = user_id
uri = '%s/v1/conference/date/list' % self.endpoint
hdrs = urllib3.util.make_headers(
basic_auth='%s:%s' % (self.key, self.secret),
)
qs = urlencode(payload, True)
if self.debug:
print('GET %s?%s' % (uri, qs))
res = self.http.request('GET', '%s?%s' % (uri, qs), headers=hdrs)
if self.debug:
print(res)
self.res = res
def add_conference_venue (self, conference_id, user_id, venue_id):
try:
payload = {}
hdrs = {}
if conference_id is None:
raise MissingRequiredArgument('property conference_id must be provided')
payload['conference_id'] = conference_id
if user_id is None:
raise MissingRequiredArgument('property user_id must be provided')
payload['user_id'] = user_id
if venue_id is None:
raise MissingRequiredArgument('property venue_id must be provided')
payload['venue_id'] = venue_id
if conference_id is not None:
payload['conference_id'] = conference_id
if user_id is not None:
payload['user_id'] = user_id
if venue_id is not None:
payload['venue_id'] = venue_id
uri = '%s/v1/conference/venue/add' % self.endpoint
hdrs = urllib3.util.make_headers(
basic_auth='%s:%s' % (self.key, self.secret),
)
if self.debug:
print('POST %s' % uri)
def lookup_sponsor (self, id, lang=None):
try:
payload = {}
hdrs = {}
if id is None:
raise MissingRequiredArgument('property id must be provided')
payload['id'] = id
if id is not None:
payload['id'] = id
if lang is not None:
payload['lang'] = lang
uri = '%s/v1/sponsor/lookup' % self.endpoint
hdrs = urllib3.util.make_headers(
basic_auth='%s:%s' % (self.key, self.secret),
)
qs = urlencode(payload, True)
if self.debug:
print('GET %s?%s' % (uri, qs))
res = self.http.request('GET', '%s?%s' % (uri, qs), headers=hdrs)
if self.debug:
print(res)
self.res = res
def create_session_survey_response (self, material_quality, overall_rating, session_id, speaker_knowledge, speaker_presentation, user_id, user_prior_knowledge, comment_good=None, comment_improvement=None):
try:
payload = {}
hdrs = {}
if material_quality is None:
raise MissingRequiredArgument('property material_quality must be provided')
payload['material_quality'] = material_quality
if overall_rating is None:
raise MissingRequiredArgument('property overall_rating must be provided')
payload['overall_rating'] = overall_rating
if session_id is None:
raise MissingRequiredArgument('property session_id must be provided')
payload['session_id'] = session_id
if speaker_knowledge is None:
raise MissingRequiredArgument('property speaker_knowledge must be provided')
payload['speaker_knowledge'] = speaker_knowledge
if speaker_presentation is None:
raise MissingRequiredArgument('property speaker_presentation must be provided')
payload['speaker_presentation'] = speaker_presentation
if user_id is None:
raise MissingRequiredArgument('property user_id must be provided')
payload['user_id'] = user_id
if user_prior_knowledge is None:
raise MissingRequiredArgument('property user_prior_knowledge must be provided')
payload['user_prior_knowledge'] = user_prior_knowledge
if comment_good is not None:
payload['comment_good'] = comment_good
if comment_improvement is not None:
def add_conference_credential (self, conference_id, data, type, user_id):
try:
payload = {}
hdrs = {}
if conference_id is None:
raise MissingRequiredArgument('property conference_id must be provided')
payload['conference_id'] = conference_id
if data is None:
raise MissingRequiredArgument('property data must be provided')
payload['data'] = data
if type is None:
raise MissingRequiredArgument('property type must be provided')
payload['type'] = type
if user_id is None:
raise MissingRequiredArgument('property user_id must be provided')
payload['user_id'] = user_id
if conference_id is not None:
payload['conference_id'] = conference_id
if data is not None:
payload['data'] = data
if type is not None:
payload['type'] = type
if user_id is not None:
payload['user_id'] = user_id
uri = '%s/v1/conference/credentials/add' % self.endpoint
hdrs = urllib3.util.make_headers(
basic_auth='%s:%s' % (self.key, self.secret),
)
def update_user (self, id, user_id, email=None, first_name=None, lang=None, last_name=None, nickname=None, tshirt_size=None, **args):
try:
payload = {}
hdrs = {}
if id is None:
raise MissingRequiredArgument('property id must be provided')
payload['id'] = id
if user_id is None:
raise MissingRequiredArgument('property user_id must be provided')
payload['user_id'] = user_id
if email is not None:
payload['email'] = email
if first_name is not None:
payload['first_name'] = first_name
if id is not None:
payload['id'] = id
if lang is not None:
payload['lang'] = lang
if last_name is not None:
payload['last_name'] = last_name
if nickname is not None:
payload['nickname'] = nickname
if tshirt_size is not None:
payload['tshirt_size'] = tshirt_size
if user_id is not None:
def create_question (self, body, session_id, user_id):
try:
payload = {}
hdrs = {}
if body is None:
raise MissingRequiredArgument('property body must be provided')
payload['body'] = body
if session_id is None:
raise MissingRequiredArgument('property session_id must be provided')
payload['session_id'] = session_id
if user_id is None:
raise MissingRequiredArgument('property user_id must be provided')
payload['user_id'] = user_id
if body is not None:
payload['body'] = body
if session_id is not None:
payload['session_id'] = session_id
if user_id is not None:
payload['user_id'] = user_id
uri = '%s/v1/question/create' % self.endpoint
hdrs = urllib3.util.make_headers(
basic_auth='%s:%s' % (self.key, self.secret),
)
qs = urlencode(payload, True)
if self.debug:
print('GET %s?%s' % (uri, qs))
res = self.http.request('GET', '%s?%s' % (uri, qs), headers=hdrs)
if self.debug: