Code
stringlengths
103
85.9k
Summary
listlengths
0
94
Please provide a description of the function:def post_event_unpublish(self, id, **data): return self.post("/events/{0}/unpublish/".format(id), data=data)
[ "\n POST /events/:id/unpublish/\n Unpublishes an event. In order for a free event to be unpublished, it must not have any pending or completed orders,\n even if the event is in the past. In order for a paid event to be unpublished, it must not have any pending or completed\n orders, unless the event has been completed and paid out. Returns a boolean indicating success or failure of the\n unpublish.\n " ]
Please provide a description of the function:def post_event_cancel(self, id, **data): return self.post("/events/{0}/cancel/".format(id), data=data)
[ "\n POST /events/:id/cancel/\n Cancels an event if it has not already been deleted. In order for cancel to be permitted, there must be no pending or\n completed orders. Returns a boolean indicating success or failure of the cancel.\n " ]
Please provide a description of the function:def delete_event(self, id, **data): return self.delete("/events/{0}/".format(id), data=data)
[ "\n DELETE /events/:id/\n Deletes an event if the delete is permitted. In order for a delete to be permitted, there must be no pending or\n completed orders. Returns a boolean indicating success or failure of the delete.\n " ]
Please provide a description of the function:def get_event_display_settings(self, id, **data): return self.get("/events/{0}/display_settings/".format(id), data=data)
[ "\n GET /events/:id/display_settings/\n Retrieves the display settings for an event.\n " ]
Please provide a description of the function:def post_event_display_settings(self, id, **data): return self.post("/events/{0}/display_settings/".format(id), data=data)
[ "\n POST /events/:id/display_settings/\n Updates the display settings for an event.\n " ]
Please provide a description of the function:def get_event_ticket_classes(self, id, **data): return self.get("/events/{0}/ticket_classes/".format(id), data=data)
[ "\n GET /events/:id/ticket_classes/\n Returns a :ref:`paginated <pagination>` response with a key of\n ``ticket_classes``, containing a list of :format:`ticket_class`.\n " ]
Please provide a description of the function:def post_event_ticket_classes(self, id, **data): return self.post("/events/{0}/ticket_classes/".format(id), data=data)
[ "\n POST /events/:id/ticket_classes/\n Creates a new ticket class, returning the result as a :format:`ticket_class`\n under the key ``ticket_class``.\n " ]
Please provide a description of the function:def get_event_ticket_class(self, id, ticket_class_id, **data): return self.get("/events/{0}/ticket_classes/{0}/".format(id,ticket_class_id), data=data)
[ "\n GET /events/:id/ticket_classes/:ticket_class_id/\n Gets and returns a single :format:`ticket_class` by ID, as the key\n ``ticket_class``.\n " ]
Please provide a description of the function:def post_event_ticket_class(self, id, ticket_class_id, **data): return self.post("/events/{0}/ticket_classes/{0}/".format(id,ticket_class_id), data=data)
[ "\n POST /events/:id/ticket_classes/:ticket_class_id/\n Updates an existing ticket class, returning the updated result as a :format:`ticket_class` under the key ``ticket_class``.\n " ]
Please provide a description of the function:def delete_event_ticket_class(self, id, ticket_class_id, **data): return self.delete("/events/{0}/ticket_classes/{0}/".format(id,ticket_class_id), data=data)
[ "\n DELETE /events/:id/ticket_classes/:ticket_class_id/\n Deletes the ticket class. Returns ``{\"deleted\": true}``.\n " ]
Please provide a description of the function:def get_event_canned_questions(self, id, **data): return self.get("/events/{0}/canned_questions/".format(id), data=data)
[ "\n GET /events/:id/canned_questions/\n This endpoint returns canned questions of a single event (examples: first name, last name, company, prefix, etc.). This endpoint will return :format:`question`.\n " ]
Please provide a description of the function:def get_event_questions(self, id, **data): return self.get("/events/{0}/questions/".format(id), data=data)
[ "\n GET /events/:id/questions/\n Eventbrite allows event organizers to add custom questions that attendees fill\n out upon registration. This endpoint can be helpful for determining what\n custom information is collected and available per event.\n This endpoint will return :format:`question`.\n " ]
Please provide a description of the function:def get_event_question(self, id, question_id, **data): return self.get("/events/{0}/questions/{0}/".format(id,question_id), data=data)
[ "\n GET /events/:id/questions/:question_id/\n This endpoint will return :format:`question` for a specific question id.\n " ]
Please provide a description of the function:def get_event_attendees(self, id, **data): return self.get("/events/{0}/attendees/".format(id), data=data)
[ "\n GET /events/:id/attendees/\n Returns a :ref:`paginated <pagination>` response with a key of ``attendees``, containing a list of :format:`attendee`.\n " ]
Please provide a description of the function:def get_event_attendee(self, id, attendee_id, **data): return self.get("/events/{0}/attendees/{0}/".format(id,attendee_id), data=data)
[ "\n GET /events/:id/attendees/:attendee_id/\n Returns a single :format:`attendee` by ID, as the key ``attendee``.\n " ]
Please provide a description of the function:def get_event_orders(self, id, **data): return self.get("/events/{0}/orders/".format(id), data=data)
[ "\n GET /events/:id/orders/\n Returns a :ref:`paginated <pagination>` response with a key of ``orders``, containing a list of :format:`order` against this event.\n " ]
Please provide a description of the function:def get_event_discounts(self, id, **data): return self.get("/events/{0}/discounts/".format(id), data=data)
[ "\n GET /events/:id/discounts/\n Returns a :ref:`paginated <pagination>` response with a key of ``discounts``,\n containing a list of :format:`discounts <discount>` available on this event.\n field_error event_id NOT_FOUND\n The event id you are attempting to use does not exist.\n " ]
Please provide a description of the function:def post_event_discounts(self, id, **data): return self.post("/events/{0}/discounts/".format(id), data=data)
[ "\n POST /events/:id/discounts/\n Creates a new discount; returns the result as a :format:`discount` as the key ``discount``.\n " ]
Please provide a description of the function:def get_event_discount(self, id, discount_id, **data): return self.get("/events/{0}/discounts/{0}/".format(id,discount_id), data=data)
[ "\n GET /events/:id/discounts/:discount_id/\n Gets a :format:`discount` by ID as the key ``discount``.\n " ]
Please provide a description of the function:def post_event_discount(self, id, discount_id, **data): return self.post("/events/{0}/discounts/{0}/".format(id,discount_id), data=data)
[ "\n POST /events/:id/discounts/:discount_id/\n Updates a discount; returns the result as a :format:`discount` as the key ``discount``.\n " ]
Please provide a description of the function:def get_event_public_discounts(self, id, **data): return self.get("/events/{0}/public_discounts/".format(id), data=data)
[ "\n GET /events/:id/public_discounts/\n Returns a :ref:`paginated <pagination>` response with a key of ``discounts``, containing a list of public :format:`discounts <discount>` available on this event.\n Note that public discounts and discounts have exactly the same form and structure; they're just namespaced separately, and public ones (and the public GET endpoints) are visible to anyone who can see the event.\n " ]
Please provide a description of the function:def post_event_public_discounts(self, id, **data): return self.post("/events/{0}/public_discounts/".format(id), data=data)
[ "\n POST /events/:id/public_discounts/\n Creates a new public discount; returns the result as a :format:`discount` as the key ``discount``.\n " ]
Please provide a description of the function:def get_event_public_discount(self, id, discount_id, **data): return self.get("/events/{0}/public_discounts/{0}/".format(id,discount_id), data=data)
[ "\n GET /events/:id/public_discounts/:discount_id/\n Gets a public :format:`discount` by ID as the key ``discount``.\n " ]
Please provide a description of the function:def post_event_public_discount(self, id, discount_id, **data): return self.post("/events/{0}/public_discounts/{0}/".format(id,discount_id), data=data)
[ "\n POST /events/:id/public_discounts/:discount_id/\n Updates a public discount; returns the result as a :format:`discount` as the key ``discount``.\n " ]
Please provide a description of the function:def delete_event_public_discount(self, id, discount_id, **data): return self.delete("/events/{0}/public_discounts/{0}/".format(id,discount_id), data=data)
[ "\n DELETE /events/:id/public_discounts/:discount_id/\n Deletes a public discount.\n " ]
Please provide a description of the function:def get_event_access_codes(self, id, **data): return self.get("/events/{0}/access_codes/".format(id), data=data)
[ "\n GET /events/:id/access_codes/\n Returns a :ref:`paginated <pagination>` response with a key of ``access_codes``, containing a list of :format:`access_codes <access_code>` available on this event.\n " ]
Please provide a description of the function:def post_event_access_codes(self, id, **data): return self.post("/events/{0}/access_codes/".format(id), data=data)
[ "\n POST /events/:id/access_codes/\n Creates a new access code; returns the result as a :format:`access_code` as the key ``access_code``.\n " ]
Please provide a description of the function:def get_event_access_code(self, id, access_code_id, **data): return self.get("/events/{0}/access_codes/{0}/".format(id,access_code_id), data=data)
[ "\n GET /events/:id/access_codes/:access_code_id/\n Gets a :format:`access_code` by ID as the key ``access_code``.\n " ]
Please provide a description of the function:def post_event_access_code(self, id, access_code_id, **data): return self.post("/events/{0}/access_codes/{0}/".format(id,access_code_id), data=data)
[ "\n POST /events/:id/access_codes/:access_code_id/\n Updates an access code; returns the result as a :format:`access_code` as the\n key ``access_code``.\n " ]
Please provide a description of the function:def get_event_transfers(self, id, **data): return self.get("/events/{0}/transfers/".format(id), data=data)
[ "\n GET /events/:id/transfers/\n Returns a list of :format:`transfers` for the event.\n " ]
Please provide a description of the function:def get_event_teams(self, id, **data): return self.get("/events/{0}/teams/".format(id), data=data)
[ "\n GET /events/:id/teams/\n Returns a list of :format:`teams` for the event.\n " ]
Please provide a description of the function:def get_event_team(self, id, team_id, **data): return self.get("/events/{0}/teams/{0}/".format(id,team_id), data=data)
[ "\n GET /events/:id/teams/:team_id/\n Returns information for a single :format:`teams`.\n " ]
Please provide a description of the function:def get_event_teams_attendees(self, id, team_id, **data): return self.get("/events/{0}/teams/{0}/attendees/".format(id,team_id), data=data)
[ "\n GET /events/:id/teams/:team_id/attendees/\n Returns :format:`attendees` for a single :format:`teams`.\n " ]
Please provide a description of the function:def get_one_series(self, id, **data): return self.get("/series/{0}/".format(id), data=data)
[ "\n GET /series/:id/\n Returns a repeating event series parent object for the specified repeating event series.\n .. _post-series-by-id:\n " ]
Please provide a description of the function:def post_one_series(self, id, **data): return self.post("/series/{0}/".format(id), data=data)
[ "\n POST /series/:id/\n Updates a repeating event series parent object, and optionally also creates more event dates or updates or deletes\n existing event dates in the series. In order for a series date to be deleted or updated, there must be no pending or\n completed orders for that date.\n .. _publish-series-by-id:\n " ]
Please provide a description of the function:def post_series_publish(self, id, **data): return self.post("/series/{0}/publish/".format(id), data=data)
[ "\n POST /series/:id/publish/\n Publishes a repeating event series and all of its occurrences that are not already canceled or deleted. Once a date is cancelled it can still be uncancelled and can be viewed by the public. A deleted date cannot be undeleted and cannot by viewed by the public. In order for\n publish to be permitted, the event must have all necessary information, including a name and description, an organizer,\n at least one ticket, and valid payment options. This API endpoint will return argument errors for event fields that\n fail to validate the publish requirements. Returns a boolean indicating success or failure of the publish.\n field_error event.name MISSING\n Your event must have a name to be published.\n field_error event.start MISSING\n Your event must have a start date to be published.\n field_error event.end MISSING\n Your event must have an end date to be published.\n field_error event.start.timezone MISSING\n Your event start and end dates must have matching time zones to be published.\n field_error event.organizer MISSING\n Your event must have an organizer to be published.\n field_error event.currency MISSING\n Your event must have a currency to be published.\n field_error event.currency INVALID\n Your event must have a valid currency to be published.\n field_error event.tickets MISSING\n Your event must have at least one ticket to be published.\n field_error event.tickets.N.name MISSING\n All tickets must have names in order for your event to be published. The N will be the ticket class ID with the\n error.\n field_error event.tickets.N.quantity_total MISSING\n All non-donation tickets must have an available quantity value in order for your event to be published. The N\n will be the ticket class ID with the error.\n field_error event.tickets.N.cost MISSING\n All non-donation tickets must have a cost (which can be ``0.00`` for free tickets) in order for your event to\n be published. The N will be the ticket class ID with the error.\n .. _unpublish-series-by-id:\n " ]
Please provide a description of the function:def post_series_unpublish(self, id, **data): return self.post("/series/{0}/unpublish/".format(id), data=data)
[ "\n POST /series/:id/unpublish/\n Unpublishes a repeating event series and all of its occurrences that are not already completed, canceled, or deleted. In\n order for a free series to be unpublished, it must not have any pending or completed orders for any dates, even past\n dates. In order for a paid series to be unpublished, it must not have any pending or completed orders for any dates,\n except that completed orders for past dates that have been completed and paid out do not prevent an unpublish. Returns\n a boolean indicating success or failure of the unpublish.\n .. _cancel-series-by-id:\n " ]
Please provide a description of the function:def post_series_cancel(self, id, **data): return self.post("/series/{0}/cancel/".format(id), data=data)
[ "\n POST /series/:id/cancel/\n Cancels a repeating event series and all of its occurrences that are not already canceled or deleted. In order for\n cancel to be permitted, there must be no pending or completed orders for any dates in the series. Returns a boolean\n indicating success or failure of the cancel.\n .. _delete-series-by-id:\n " ]
Please provide a description of the function:def delete_one_series(self, id, **data): return self.delete("/series/{0}/".format(id), data=data)
[ "\n DELETE /series/:id/\n Deletes a repeating event series and all of its occurrences if the delete is permitted. In order for a delete to be\n permitted, there must be no pending or completed orders for any dates in the series. Returns a boolean indicating\n success or failure of the delete.\n .. _get-series-events:\n " ]
Please provide a description of the function:def get_series_events(self, id, **data): return self.get("/series/{0}/events/".format(id), data=data)
[ "\n GET /series/:id/events/\n Returns all of the events that belong to this repeating event series.\n .. _post-series-dates:\n " ]
Please provide a description of the function:def post_series_events(self, id, **data): return self.post("/series/{0}/events/".format(id), data=data)
[ "\n POST /series/:id/events/\n Creates more event dates or updates or deletes existing event dates in a repeating event series. In order for a series\n date to be deleted or updated, there must be no pending or completed orders for that date.\n " ]
Please provide a description of the function:def get_formats(self, id, **data): return self.get("/formats/{0}/".format(id), data=data)
[ "\n GET /formats/:id/\n Gets a :format:`format` by ID as ``format``. " ]
Please provide a description of the function:def get_media(self, id, **data): return self.get("/media/{0}/".format(id), data=data)
[ "\n GET /media/:id/\n Return an :format:`image` for a given id.\n " ]
Please provide a description of the function:def get_order(self, id, **data): return self.get("/orders/{0}/".format(id), data=data)
[ "\n GET /orders/:id/\n Gets an :format:`order` by ID as the key ``order``.\n " ]
Please provide a description of the function:def get_organizer(self, id, **data): return self.get("/organizers/{0}/".format(id), data=data)
[ "\n GET /organizers/:id/\n Gets an :format:`organizer` by ID as ``organizer``.\n " ]
Please provide a description of the function:def post_organizer(self, id, **data): return self.post("/organizers/{0}/".format(id), data=data)
[ "\n POST /organizers/:id/\n Updates an :format:`organizer` and returns it as as ``organizer``.\n field_error organizer.name DUPLICATE\n You already have another organizer with this name.\n field_error organizer.short_name UNAVAILABLE\n There is already another organizer or event with this short name.\n field_error organizer.logo_id INVALID\n This is not a valid image.\n field_error organizer.facebook INVALID\n This is not a valid Facebook profile URL.\n field_error organizer.facebook NO_GROUP_PAGES\n The Facebook URL cannot be a group page.\n " ]
Please provide a description of the function:def get_organizers_events(self, id, **data): return self.get("/organizers/{0}/events/".format(id), data=data)
[ "\n GET /organizers/:id/events/\n Gets events of the :format:`organizer`.\n " ]
Please provide a description of the function:def get_refund_request(self, id, **data): return self.get("/refund_requests/{0}/".format(id), data=data)
[ "\n GET /refund_requests/:id/\n Gets a :format:`refund-request` for the specified refund request.\n error NOT_AUTHORIZED\n Only the order's buyer can create a refund request\n error FIELD_UNKNOWN\n The refund request id provided is unknown\n " ]
Please provide a description of the function:def post_refund_request(self, id, **data): return self.post("/refund_requests/{0}/".format(id), data=data)
[ "\n POST /refund_requests/:id/\n Update a :format:`refund-request` for a specific order. Each element in items is a :format:`refund-item`\n error NOT_AUTHORIZED\n Only the order's buyer can create a refund request\n error FIELD_UNKNOWN\n The refund request id provided is unknown\n error INVALID_REFUND_REQUEST_STATUS\n The refund request is not the correct status for the change\n " ]
Please provide a description of the function:def get_tracking_beacon(self, tracking_beacons_id, **data): return self.get("/tracking_beacons/{0}/".format(tracking_beacons_id), data=data)
[ "\n GET /tracking_beacons/:tracking_beacons_id/\n Returns the :format:`tracking_beacon` with the specified :tracking_beacons_id.\n " ]
Please provide a description of the function:def post_tracking_beacon(self, tracking_beacons_id, **data): return self.post("/tracking_beacons/{0}/".format(tracking_beacons_id), data=data)
[ "\n POST /tracking_beacons/:tracking_beacons_id/\n Updates the :format:`tracking_beacons` with the specified :tracking_beacons_id. Though ``event_id`` and ``user_id`` are not individually required, it is a requirement to have a tracking beacon where either one must exist. Returns an :format:`tracking_beacon` as ``tracking_beacon``.\n " ]
Please provide a description of the function:def delete_tracking_beacon(self, tracking_beacons_id, **data): return self.delete("/tracking_beacons/{0}/".format(tracking_beacons_id), data=data)
[ "\n DELETE /tracking_beacons/:tracking_beacons_id/\n Delete the :format:`tracking_beacons` with the specified :tracking_beacons_id.\n " ]
Please provide a description of the function:def get_event_tracking_beacons(self, event_id, **data): return self.get("/events/{0}/tracking_beacons/".format(event_id), data=data)
[ "\n GET /events/:event_id/tracking_beacons/\n Returns the list of :format:`tracking_beacon` for the event :event_id\n " ]
Please provide a description of the function:def get_user_tracking_beacons(self, user_id, **data): return self.get("/users/{0}/tracking_beacons/".format(user_id), data=data)
[ "\n GET /users/:user_id/tracking_beacons/\n Returns the list of :format:`tracking_beacon` for the user :user_id\n " ]
Please provide a description of the function:def get_user(self, id, **data): return self.get("/users/{0}/".format(id), data=data)
[ "\n GET /users/:id/\n Returns a :format:`user` for the specified user as ``user``. If you want to get details about the currently authenticated user, use ``/users/me/``.\n " ]
Please provide a description of the function:def get_user_orders(self, id, **data): return self.get("/users/{0}/orders/".format(id), data=data)
[ "\n GET /users/:id/orders/\n Returns a :ref:`paginated <pagination>` response of :format:`orders <order>`, under the key ``orders``, of all orders the user has placed (i.e. where the user was the person buying the tickets).\n :param int id: The id assigned to a user.\n :param datetime changed_since: (optional) Only return attendees changed on or after the time given.\n .. note:: A datetime represented as a string in ISO8601 combined date and time format, always in UTC.\n " ]
Please provide a description of the function:def get_user_organizers(self, id, **data): return self.get("/users/{0}/organizers/".format(id), data=data)
[ "\n GET /users/:id/organizers/\n Returns a :ref:`paginated <pagination>` response of :format:`organizer` objects that are owned by the user.\n " ]
Please provide a description of the function:def get_user_owned_events(self, id, **data): return self.get("/users/{0}/owned_events/".format(id), data=data)
[ "\n GET /users/:id/owned_events/\n Returns a :ref:`paginated <pagination>` response of :format:`events <event>`, under\n the key ``events``, of all events the user owns (i.e. events they are organising)\n " ]
Please provide a description of the function:def get_user_events(self, id, **data): return self.get("/users/{0}/events/".format(id), data=data)
[ "\n GET /users/:id/events/\n Returns a :ref:`paginated <pagination>` response of :format:`events <event>`, under the key ``events``, of all events the user has access to\n " ]
Please provide a description of the function:def get_user_venues(self, id, **data): return self.get("/users/{0}/venues/".format(id), data=data)
[ "\n GET /users/:id/venues/\n Returns a paginated response of :format:`venue` objects that are owned by the user.\n " ]
Please provide a description of the function:def get_user_owned_event_attendees(self, id, **data): return self.get("/users/{0}/owned_event_attendees/".format(id), data=data)
[ "\n GET /users/:id/owned_event_attendees/\n Returns a :ref:`paginated <pagination>` response of :format:`attendees <attendee>`,\n under the key ``attendees``, of attendees visiting any of the events the user owns\n (events that would be returned from ``/users/:id/owned_events/``)\n " ]
Please provide a description of the function:def get_user_owned_event_orders(self, id, **data): return self.get("/users/{0}/owned_event_orders/".format(id), data=data)
[ "\n GET /users/:id/owned_event_orders/\n Returns a :ref:`paginated <pagination>` response of :format:`orders <order>`,\n under the key ``orders``, of orders placed against any of the events the user owns\n (events that would be returned from ``/users/:id/owned_events/``)\n " ]
Please provide a description of the function:def get_user_contact_lists(self, id, **data): return self.get("/users/{0}/contact_lists/".format(id), data=data)
[ "\n GET /users/:id/contact_lists/\n Returns a list of :format:`contact_list` that the user owns as the key\n ``contact_lists``.\n " ]
Please provide a description of the function:def post_user_contact_lists(self, id, **data): return self.post("/users/{0}/contact_lists/".format(id), data=data)
[ "\n POST /users/:id/contact_lists/\n Makes a new :format:`contact_list` for the user and returns it as\n ``contact_list``.\n " ]
Please provide a description of the function:def get_user_contact_list(self, id, contact_list_id, **data): return self.get("/users/{0}/contact_lists/{0}/".format(id,contact_list_id), data=data)
[ "\n GET /users/:id/contact_lists/:contact_list_id/\n Gets a user's :format:`contact_list` by ID as ``contact_list``.\n " ]
Please provide a description of the function:def post_user_contact_list(self, id, contact_list_id, **data): return self.post("/users/{0}/contact_lists/{0}/".format(id,contact_list_id), data=data)
[ "\n POST /users/:id/contact_lists/:contact_list_id/\n Updates the :format:`contact_list` and returns it as ``contact_list``.\n " ]
Please provide a description of the function:def delete_user_contact_list(self, id, contact_list_id, **data): return self.delete("/users/{0}/contact_lists/{0}/".format(id,contact_list_id), data=data)
[ "\n DELETE /users/:id/contact_lists/:contact_list_id/\n Deletes the contact list. Returns ``{\"deleted\": true}``.\n " ]
Please provide a description of the function:def get_user_contact_lists_contacts(self, id, contact_list_id, **data): return self.get("/users/{0}/contact_lists/{0}/contacts/".format(id,contact_list_id), data=data)
[ "\n GET /users/:id/contact_lists/:contact_list_id/contacts/\n Returns the :format:`contacts <contact>` on the contact list\n as ``contacts``.\n " ]
Please provide a description of the function:def post_user_contact_lists_contacts(self, id, contact_list_id, **data): return self.post("/users/{0}/contact_lists/{0}/contacts/".format(id,contact_list_id), data=data)
[ "\n POST /users/:id/contact_lists/:contact_list_id/contacts/\n Adds a new contact to the contact list. Returns ``{\"created\": true}``.\n There is no way to update entries in the list; just delete the old one\n and add the updated version.\n " ]
Please provide a description of the function:def delete_user_contact_lists_contacts(self, id, contact_list_id, **data): return self.delete("/users/{0}/contact_lists/{0}/contacts/".format(id,contact_list_id), data=data)
[ "\n DELETE /users/:id/contact_lists/:contact_list_id/contacts/\n Deletes the specified contact from the contact list.\n Returns ``{\"deleted\": true}``.\n=======\n " ]
Please provide a description of the function:def get_user_bookmarks(self, id, **data): return self.get("/users/{0}/bookmarks/".format(id), data=data)
[ "\n GET /users/:id/bookmarks/\n Gets all the user's saved events.\n In order to update the saved events list, the user must unsave or save each event.\n A user is authorized to only see his/her saved events.\n " ]
Please provide a description of the function:def post_user_bookmarks_save(self, id, **data): return self.post("/users/{0}/bookmarks/save/".format(id), data=data)
[ "\n POST /users/:id/bookmarks/save/\n Adds a new bookmark for the user. Returns ``{\"created\": true}``.\n A user is only authorized to save his/her own events.\n " ]
Please provide a description of the function:def post_user_bookmarks_unsave(self, id, **data): return self.post("/users/{0}/bookmarks/unsave/".format(id), data=data)
[ "\n POST /users/:id/bookmarks/unsave/\n Removes the specified bookmark from the event for the user. Returns ``{\"deleted\": true}``.\n A user is only authorized to unsave his/her own events.\n error NOT_AUTHORIZED\n You are not authorized to unsave an event for this user.\n error ARGUMENTS_ERROR\n There are errors with your arguments.\n " ]
Please provide a description of the function:def get_venue(self, id, **data): return self.get("/venues/{0}/".format(id), data=data)
[ "\n GET /venues/:id/\n Returns a :format:`venue` object.\n " ]
Please provide a description of the function:def post_venue(self, id, **data): return self.post("/venues/{0}/".format(id), data=data)
[ "\n POST /venues/:id/\n Updates a :format:`venue` and returns it as an object.\n " ]
Please provide a description of the function:def get_venues_events(self, id, **data): return self.get("/venues/{0}/events/".format(id), data=data)
[ "\n GET /venues/:id/events/\n Returns events of a given :format:`venue`.\n " ]
Please provide a description of the function:def get_webhook(self, id, **data): return self.get("/webhooks/{0}/".format(id), data=data)
[ "\n GET /webhooks/:id/\n Returns a :format:`webhook` for the specified webhook as ``webhook``.\n " ]
Please provide a description of the function:def delete_webhook(self, id, **data): return self.delete("/webhooks/{0}/".format(id), data=data)
[ "\n DELETE /webhooks/:id/\n Deletes the specified :format:`webhook` object.\n " ]
Please provide a description of the function:def get_user(self, user_id=None): if user_id: return self.get('/users/{0}/'.format(user_id)) return self.get('/users/me/')
[ "\n Returns a user for the specified user as user.\n\n GET users/:id/\n\n :param int user_id: (optional) The id assigned to a user\n\n " ]
Please provide a description of the function:def get_user_orders(self, user_id=None, changed_since=None): if user_id: url = '/users/{0}/orders/'.format(user_id) else: url = '/users/me/orders/' data = {} if changed_since: data['changed_since'] = changed_since return self.get(url, data=data)
[ "\n Returns a paginated response of orders, under the key orders, of all\n orders the user has placed (i.e. where the user was the person buying\n the tickets).\n\n GET users/:id/orders/\n\n :param int user_id: (optional) The id assigned to a user. Leave empty\n to get current user.\n :param datetime changed_since: (optional) Only return attendees changed\n on or after the time given\n\n .. note:: A datetime represented as a string in ISO8601 combined date\n and time format, always in UTC.\n " ]
Please provide a description of the function:def get_event_attendees(self, event_id, status=None, changed_since=None): data = {} if status: # TODO - check the types of valid status data['status'] = status if changed_since: data['changed_since'] = changed_since return self.get("/events/{0}/attendees/".format(event_id), data=data)
[ "\n Returns a paginated response with a key of attendees, containing a\n list of attendee.\n\n GET /events/:id/attendees/\n " ]
Please provide a description of the function:def post_event_discount( self, event_id, discount_code, discount_amount_off=None, discount_percent_off=None, discount_ticket_ids=None, discount_quantity_available=None, discount_start_date=None, discount_end_date=None): data = construct_namespaced_dict("discount", locals()) return self.post("/events/{0}/discounts/".format(event_id), data=data)
[ "\n POST /events/:id/discounts/\n\n discount_code string required Code to activate discount\n discount_amount_off unknown optional Fixed reduction amount\n discount_percent_off string optional Percentage reduction\n discount_ticket_ids unknown optional IDs of tickets to limit discount to\n discount_quantity_available integer optional Number of discount uses\n discount_start_date datetime optional Allow use from this date\n discount_end_date datetime optional Allow use until this date\n\n TODO: Consider deprecating this method\n " ]
Please provide a description of the function:def webhook_to_object(self, webhook): if isinstance(webhook, string_type): # If still JSON, convert to a Python dict webhook = json.dumps(webhook) # if a flask.Request object, try to convert that to a webhook if not isinstance(webhook, dict): webhook = get_webhook_from_request(webhook) try: webhook['api_url'] except KeyError: raise InvalidWebhook payload = self.get(webhook['api_url']) return payload
[ "\n Converts JSON sent by an Eventbrite Webhook to the appropriate\n Eventbrite object.\n\n # TODO - Add capability to handle Django request objects\n " ]
Please provide a description of the function:def get_params_from_page(path, file_name, method_count): # open the rendered file. file_name = file_name.replace(".rst", "") file_path = "{0}/../_build/html/endpoints/{1}/index.html".format( path, file_name) soup = bs4.BeautifulSoup(open(file_path)) # Pull out the relevant section section = soup.find_all('div', class_='section')[method_count] # get the tbody of the params table tbody = section.find('tbody') params = [] if tbody is not None: for row in tbody.find_all('tr'): name, param_type, required, description = row.find_all('td') required = required.text == 'Yes' param = dict( name=name.text, type=param_type.text, required=required, description=description.text ) params.append(param) params = sorted(params, key=lambda k: not k['required']) return params
[ " This function accesses the rendered content.\n We must do this because how the params are not defined in the docs,\n but rather the rendered HTML\n " ]
Please provide a description of the function:def is_valid_ip(ip_address): valid = True try: socket.inet_aton(ip_address.strip()) except: valid = False return valid
[ "\n Check Validity of an IP address\n " ]
Please provide a description of the function:def get_ip_address_from_request(request): PRIVATE_IPS_PREFIX = ('10.', '172.', '192.', '127.') ip_address = '' x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR', '') if x_forwarded_for and ',' not in x_forwarded_for: if not x_forwarded_for.startswith(PRIVATE_IPS_PREFIX) and is_valid_ip(x_forwarded_for): ip_address = x_forwarded_for.strip() else: ips = [ip.strip() for ip in x_forwarded_for.split(',')] for ip in ips: if ip.startswith(PRIVATE_IPS_PREFIX): continue elif not is_valid_ip(ip): continue else: ip_address = ip break if not ip_address: x_real_ip = request.META.get('HTTP_X_REAL_IP', '') if x_real_ip: if not x_real_ip.startswith(PRIVATE_IPS_PREFIX) and is_valid_ip(x_real_ip): ip_address = x_real_ip.strip() if not ip_address: remote_addr = request.META.get('REMOTE_ADDR', '') if remote_addr: if not remote_addr.startswith(PRIVATE_IPS_PREFIX) and is_valid_ip(remote_addr): ip_address = remote_addr.strip() if remote_addr.startswith(PRIVATE_IPS_PREFIX) and is_valid_ip(remote_addr): ip_address = remote_addr.strip() if not ip_address: ip_address = '127.0.0.1' return ip_address
[ "\n Makes the best attempt to get the client's real IP or return the loopback\n " ]
Please provide a description of the function:def process_request(self, request): # Section adjusted to restrict login to ?edit # (sing cms-toolbar-login)into DjangoCMS login. restricted_request_uri = request.path.startswith( reverse('admin:index') or "cms-toolbar-login" in request.build_absolute_uri() ) if restricted_request_uri and request.method == 'POST': # AllowedIP table emty means access is always granted if AllowedIP.objects.count() > 0: # If there are wildcard IPs access is always granted if AllowedIP.objects.filter(ip_address="*").count() == 0: request_ip = get_ip_address_from_request(request) # If the request_ip is in the AllowedIP the access # is granted if AllowedIP.objects.filter(ip_address=request_ip).count() == 0: # We check regular expressions defining ranges # of IPs. If any range contains the request_ip # the access is granted for regex_ip_range in AllowedIP.objects.filter(ip_address__endswith="*"): if re.match(regex_ip_range.ip_address.replace("*", ".*"), request_ip): return None return HttpResponseForbidden("Access to admin is denied.")
[ "\n Check if the request is made form an allowed IP\n " ]
Please provide a description of the function:def get_settings(editor_override=None): flavor = getattr(settings, "DJANGO_WYSIWYG_FLAVOR", "yui") if editor_override is not None: flavor = editor_override return { "DJANGO_WYSIWYG_MEDIA_URL": getattr(settings, "DJANGO_WYSIWYG_MEDIA_URL", urljoin(settings.STATIC_URL, flavor) + '/'), "DJANGO_WYSIWYG_FLAVOR": flavor, }
[ "Utility function to retrieve settings.py values with defaults" ]
Please provide a description of the function:def wysiwyg_setup(protocol="http", editor_override=None): ctx = { "protocol": protocol, } ctx.update(get_settings(editor_override=editor_override)) return render_to_string( "django_wysiwyg/%s/includes.html" % ctx['DJANGO_WYSIWYG_FLAVOR'], ctx )
[ "\n Create the <style> and <script> tags needed to initialize the rich text editor.\n\n Create a local django_wysiwyg/includes.html template if you don't want to use Yahoo's CDN\n " ]
Please provide a description of the function:def wysiwyg_editor(field_id, editor_name=None, config=None, editor_override=None): if not editor_name: editor_name = "%s_editor" % field_id ctx = { 'field_id': field_id, 'editor_name': editor_name, 'config': config } ctx.update(get_settings(editor_override=editor_override)) if editor_override is not None: ctx['DJANGO_WYSIWYG_FLAVOR'] = editor_override return render_to_string( "django_wysiwyg/%s/editor_instance.html" % ctx['DJANGO_WYSIWYG_FLAVOR'], ctx )
[ "\n Turn the textarea #field_id into a rich editor. If you do not specify the\n JavaScript name of the editor, it will be derived from the field_id.\n\n If you don't specify the editor_name then you'll have a JavaScript object\n named \"<field_id>_editor\" in the global namespace. We give you control of\n this in case you have a complex JS ctxironment.\n " ]
Please provide a description of the function:def wysiwyg_static_url(appname, prefix, default_path): if appname in settings.INSTALLED_APPS: return urljoin(settings.STATIC_URL, prefix) else: return default_path
[ "\n Automatically use an prefix if a given application is installed.\n For example, if django-ckeditor is installed, use it's STATIC_URL/ckeditor folder to find the CKEditor distribution.\n When the application does not available, fallback to the default path.\n\n This is a function for the internal templates of *django-wysiwyg*.\n " ]
Please provide a description of the function:def clean_html5lib(input): from html5lib import treebuilders, treewalkers, serializer, sanitizer p = html5lib.HTMLParser(tree=treebuilders.getTreeBuilder("dom")) dom_tree = p.parseFragment(input) walker = treewalkers.getTreeWalker("dom") stream = walker(dom_tree) s = serializer.htmlserializer.HTMLSerializer(omit_optional_tags=False) return "".join(s.serialize(stream))
[ "\n Takes an HTML fragment and processes it using html5lib to ensure that the HTML is well-formed.\n\n >>> clean_html5lib(\"<p>Foo<b>bar</b></p>\")\n u'<p>Foo<b>bar</b></p>'\n >>> clean_html5lib(\"<p>Foo<b>bar</b><i>Ooops!</p>\")\n u'<p>Foo<b>bar</b><i>Ooops!</i></p>'\n >>> clean_html5lib('<p>Foo<b>bar</b>& oops<a href=\"#foo&bar\">This is a <>link</a></p>')\n u'<p>Foo<b>bar</b>&amp; oops<a href=#foo&amp;bar>This is a &lt;&gt;link</a></p>'\n " ]
Please provide a description of the function:def as_sql(self, qn, connection=None): if self.bit: return ("(%s.%s | %d)" % (qn(self.table_alias), qn(self.column), self.bit.mask), []) return ("(%s.%s & %d)" % (qn(self.table_alias), qn(self.column), self.bit.mask), [])
[ "\n Create the proper SQL fragment. This inserts something like\n \"(T0.flags & value) != 0\".\n\n This will be called by Where.as_sql()\n " ]
Please provide a description of the function:def as_sql(self, qn, connection): engine = connection.settings_dict['ENGINE'].rsplit('.', -1)[-1] if engine.startswith('postgres'): XOR_OPERATOR = '#' elif engine.startswith('sqlite'): raise NotImplementedError else: XOR_OPERATOR = '^' if self.bit: return ("%s.%s | %d" % (qn(self.table_alias), qn(self.column), self.bit.mask), []) return ("%s.%s %s %d" % (qn(self.table_alias), qn(self.column), XOR_OPERATOR, self.bit.mask), [])
[ "\n Create the proper SQL fragment. This inserts something like\n \"(T0.flags & value) != 0\".\n\n This will be called by Where.as_sql()\n " ]
Please provide a description of the function:def get_auth(self): ''' Returns username from the configfile. ''' return (self._cfgparse.get(self._section, 'username'), self._cfgparse.get(self._section, 'password'))
[]
Please provide a description of the function:def connect(config_file=qcs.default_filename, section='info', remember_me=False, remember_me_always=False): # Retrieve login credentials. conf = qcconf.QualysConnectConfig(filename=config_file, section=section, remember_me=remember_me, remember_me_always=remember_me_always) connect = qcconn.QGConnector(conf.get_auth(), conf.get_hostname(), conf.proxies, conf.max_retries) logger.info("Finished building connector.") return connect
[ " Return a QGAPIConnect object for v1 API pulling settings from config\n file.\n " ]
Please provide a description of the function:def format_api_version(self, api_version): # Convert to int. if type(api_version) == str: api_version = api_version.lower() if api_version[0] == 'v' and api_version[1].isdigit(): # Remove first 'v' in case the user typed 'v1' or 'v2', etc. api_version = api_version[1:] # Check for input matching Qualys modules. if api_version in ('asset management', 'assets', 'tag', 'tagging', 'tags'): # Convert to Asset Management API. api_version = 'am' elif api_version in ('am2'): # Convert to Asset Management API v2 api_version = 'am2' elif api_version in ('webapp', 'web application scanning', 'webapp scanning'): # Convert to WAS API. api_version = 'was' elif api_version in ('pol', 'pc'): # Convert PC module to API number 2. api_version = 2 else: api_version = int(api_version) return api_version
[ " Return QualysGuard API version for api_version specified.\n\n " ]
Please provide a description of the function:def which_api_version(self, api_call): # Leverage patterns of calls to API methods. if api_call.endswith('.php'): # API v1. return 1 elif api_call.startswith('api/2.0/'): # API v2. return 2 elif '/am/' in api_call: # Asset Management API. return 'am' elif '/was/' in api_call: # WAS API. return 'was' return False
[ " Return QualysGuard API version for api_call specified.\n\n " ]
Please provide a description of the function:def url_api_version(self, api_version): # Set base url depending on API version. if api_version == 1: # QualysGuard API v1 url. url = "https://%s/msp/" % (self.server,) elif api_version == 2: # QualysGuard API v2 url. url = "https://%s/" % (self.server,) elif api_version == 'was': # QualysGuard REST v3 API url (Portal API). url = "https://%s/qps/rest/3.0/" % (self.server,) elif api_version == 'am': # QualysGuard REST v1 API url (Portal API). url = "https://%s/qps/rest/1.0/" % (self.server,) elif api_version == 'am2': # QualysGuard REST v1 API url (Portal API). url = "https://%s/qps/rest/2.0/" % (self.server,) else: raise Exception("Unknown QualysGuard API Version Number (%s)" % (api_version,)) logger.debug("Base url =\n%s" % (url)) return url
[ " Return base API url string for the QualysGuard api_version and server.\n\n " ]
Please provide a description of the function:def format_http_method(self, api_version, api_call, data): # Define get methods for automatic http request methodology. # # All API v2 requests are POST methods. if api_version == 2: return 'post' elif api_version == 1: if api_call in self.api_methods['1 post']: return 'post' else: return 'get' elif api_version == 'was': # WAS API call. # Because WAS API enables user to GET API resources in URI, let's chop off the resource. # '/download/was/report/18823' --> '/download/was/report/' api_call_endpoint = api_call[:api_call.rfind('/') + 1] if api_call_endpoint in self.api_methods['was get']: return 'get' # Post calls with no payload will result in HTTPError: 415 Client Error: Unsupported Media Type. if data is None: # No post data. Some calls change to GET with no post data. if api_call_endpoint in self.api_methods['was no data get']: return 'get' else: return 'post' else: # Call with post data. return 'post' else: # Asset Management API call. if api_call in self.api_methods['am get']: return 'get' else: return 'post'
[ " Return QualysGuard API http method, with POST preferred..\n\n " ]