Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_api_class_info(obj):
ignore_methods = [x[0] for x in inspect.getmembers(Api)]
def valid_method(m):
return inspect.ismethod(m) \
and not m.__name__.startswith('_') \
and m.__name__ not in ignore_methods
results = list()
for name, api in inspect.getmembers(obj, lambda x: issubclass(x.__class__, Api)):
signature = "%s%s" % (name, inspect.signature(getattr(api, '__call__')))
docstring = api.endpoint.__doc__ if not any(
(isinstance(api.endpoint, o) for o in [PrimaryEndpoint, SecondaryEndpoint])) else None
methods = list()
for method_name, method in inspect.getmembers(api, valid_method):
method_signature = method_name + str(inspect.signature(method))
methods.append(MethodInfo(method_signature, method.__doc__))
class_info = ClassInfo(name, signature, docstring, methods, len(methods))
results.append(class_info)
return sorted(results, key=lambda c: c.method_count, reverse=True)
macros.apply = SecondaryEndpoint('macros/%(id)s/apply.json')
nps = PrimaryEndpoint('nps')
nps.recipients_incremental = IncrementalEndpoint('nps/incremental/recipients.json')
nps.responses_incremental = IncrementalEndpoint('nps/incremental/responses.json')
organization_memberships = PrimaryEndpoint('organization_memberships')
organization_fields = PrimaryEndpoint('organization_fields')
organization_fields.reorder = PrimaryEndpoint('organization_fields/reorder.json')
organizations = PrimaryEndpoint('organizations')
organizations.external = SecondaryEndpoint('organizations/search.json?external_id=%(id)s')
organizations.incremental = IncrementalEndpoint('incremental/organizations.json')
organizations.organization_fields = PrimaryEndpoint('organization_fields')
organizations.organization_memberships = SecondaryEndpoint('organizations/%(id)s/organization_memberships.json')
organizations.requests = SecondaryEndpoint('organizations/%(id)s/requests.json')
organizations.tags = SecondaryEndpoint('organizations/%(id)s/tags.json')
organizations.create_or_update = PrimaryEndpoint('organizations/create_or_update')
organizations.users = SecondaryEndpoint('organizations/%(id)s/users.json')
requests = PrimaryEndpoint('requests')
requests.ccd = PrimaryEndpoint("requests/ccd")
requests.comments = SecondaryEndpoint('requests/%(id)s/comments.json')
requests.open = PrimaryEndpoint("requests/open")
requests.search = RequestSearchEndpoint('requests/search.json')
requests.solved = PrimaryEndpoint("requests/solved")
satisfaction_ratings = SatisfactionRatingEndpoint('satisfaction_ratings')
satisfaction_ratings.create = SecondaryEndpoint('tickets/%(id)s/satisfaction_rating.json')
schedules = PrimaryEndpoint('business_hours/schedules')
search = SearchEndpoint('search.json')
sharing_agreements = PrimaryEndpoint('sharing_agreements')
sla_policies = PrimaryEndpoint('slas/policies')
sla_policies.definitions = PrimaryEndpoint('slas/policies/definitions')
skips = PrimaryEndpoint('skips')
suspended_tickets = PrimaryEndpoint('suspended_tickets')
help_centre.attachments.create = SecondaryEndpoint('help_center/articles/%(id)s/attachments.json')
help_centre.attachments.create_unassociated = PrimaryEndpoint('help_center/articles/attachments')
help_centre.attachments.delete = SecondaryEndpoint('help_center/articles/attachments/%(id)s.json')
help_centre.attachments.bulk_attachments = SecondaryEndpoint('help_center/articles/%(id)s/bulk_attachments.json')
help_centre.categories = PrimaryEndpoint('help_center/categories')
help_centre.categories.articles = SecondaryEndpoint('help_center/categories/%(id)s/articles.json')
help_centre.categories.sections = SecondaryEndpoint('help_center/categories/%(id)s/sections.json')
help_centre.categories.translations = SecondaryEndpoint('help_center/categories/%(id)s/translations.json')
help_centre.categories.create_translation = SecondaryEndpoint('help_center/categories/%(id)s/translations.json')
help_centre.categories.missing_translations = SecondaryEndpoint(
'help_center/categories/%(id)s/translations/missing.json')
help_centre.categories.update_translation = MultipleIDEndpoint('help_center/categories/{}/translations/{}.json')
help_centre.categories.delete_translation = SecondaryEndpoint('help_center/translations/%(id)s.json')
help_centre.sections = PrimaryEndpoint('help_center/sections')
help_centre.sections.create = SecondaryEndpoint('help_center/categories/%(id)s/sections.json')
help_centre.sections.articles = SecondaryEndpoint('help_center/sections/%(id)s/articles.json')
help_centre.sections.translations = SecondaryEndpoint('help_center/sections/%(id)s/translations.json')
help_centre.sections.create_translation = SecondaryEndpoint('help_center/sections/%(id)s/translations.json')
help_centre.sections.missing_translations = SecondaryEndpoint(
'help_center/sections/%(id)s/translations/missing.json')
help_centre.sections.update_translation = MultipleIDEndpoint('help_center/sections/{}/translations/{}.json')
help_centre.sections.delete_translation = SecondaryEndpoint('help_center/translations/%(id)s.json')
help_centre.sections.subscriptions = SecondaryEndpoint('help_center/sections/%(id)s/subscriptions.json')
help_centre.sections.subscriptions_delete = MultipleIDEndpoint('help_center/sections/{}/subscriptions/{}.json')
help_centre.sections.access_policies = SecondaryEndpoint('help_center/sections/%(id)s/access_policy.json')
help_centre.topics = PrimaryEndpoint("community/topics")
help_centre.topics.posts = SecondaryEndpoint('community/topics/%(id)s/posts.json')
help_centre.topics.subscriptions = SecondaryEndpoint('community/topics/%(id)s/subscriptions.json')
help_centre.topics.subscriptions_delete = MultipleIDEndpoint('community/topics/{}/subscriptions/{}.json')
group_memberships.make_default = MultipleIDEndpoint('users/{}/group_memberships/{}/make_default.json')
groups = PrimaryEndpoint('groups')
groups.memberships = SecondaryEndpoint('groups/%(id)s/memberships.json')
groups.memberships_assignable = SecondaryEndpoint('groups/%(id)s/memberships/assignable.json')
groups.users = SecondaryEndpoint('groups/%(id)s/users.json')
job_statuses = PrimaryEndpoint('job_statuses')
locales = PrimaryEndpoint('locales')
links = PrimaryEndpoint('services/jira/links')
macros = MacroEndpoint('macros')
macros.apply = SecondaryEndpoint('macros/%(id)s/apply.json')
nps = PrimaryEndpoint('nps')
nps.recipients_incremental = IncrementalEndpoint('nps/incremental/recipients.json')
nps.responses_incremental = IncrementalEndpoint('nps/incremental/responses.json')
organization_memberships = PrimaryEndpoint('organization_memberships')
organization_fields = PrimaryEndpoint('organization_fields')
organization_fields.reorder = PrimaryEndpoint('organization_fields/reorder.json')
organizations = PrimaryEndpoint('organizations')
organizations.external = SecondaryEndpoint('organizations/search.json?external_id=%(id)s')
organizations.incremental = IncrementalEndpoint('incremental/organizations.json')
organizations.organization_fields = PrimaryEndpoint('organization_fields')
organizations.organization_memberships = SecondaryEndpoint('organizations/%(id)s/organization_memberships.json')
organizations.requests = SecondaryEndpoint('organizations/%(id)s/requests.json')
organizations.tags = SecondaryEndpoint('organizations/%(id)s/tags.json')
organizations.create_or_update = PrimaryEndpoint('organizations/create_or_update')
organizations.users = SecondaryEndpoint('organizations/%(id)s/users.json')
requests = PrimaryEndpoint('requests')
requests.ccd = PrimaryEndpoint("requests/ccd")
requests.comments = SecondaryEndpoint('requests/%(id)s/comments.json')
requests.open = PrimaryEndpoint("requests/open")
requests.search = RequestSearchEndpoint('requests/search.json')
requests.solved = PrimaryEndpoint("requests/solved")
sla_policies.definitions = PrimaryEndpoint('slas/policies/definitions')
skips = PrimaryEndpoint('skips')
suspended_tickets = PrimaryEndpoint('suspended_tickets')
suspended_tickets.recover = SecondaryEndpoint('suspended_tickets/%(id)s/recover.json')
tags = PrimaryEndpoint('tags')
targets = PrimaryEndpoint('targets')
ticket_fields = PrimaryEndpoint('ticket_fields')
ticket_field_options = SecondaryEndpoint('ticket_fields/%(id)s/options.json')
ticket_field_options.show = MultipleIDEndpoint('ticket_fields/{}/options/{}.json')
ticket_field_options.update = SecondaryEndpoint('ticket_fields/%(id)s/options.json')
ticket_field_options.delete = MultipleIDEndpoint('ticket_fields/{}/options/{}.json')
ticket_forms = PrimaryEndpoint('ticket_forms')
ticket_import = PrimaryEndpoint('imports/tickets')
ticket_metrics = PrimaryEndpoint('ticket_metrics')
ticket_metric_events = IncrementalEndpoint('incremental/ticket_metric_events.json')
tickets = PrimaryEndpoint('tickets')
tickets.audits = SecondaryEndpoint('tickets/%(id)s/audits.json')
tickets.audits.cursor = PrimaryEndpoint('ticket_audits')
tickets.comments = SecondaryEndpoint('tickets/%(id)s/comments.json')
tickets.comments.redact = MultipleIDEndpoint('tickets/{0}/comments/{1}/redact.json')
tickets.deleted = PrimaryEndpoint('deleted_tickets')
tickets.events = IncrementalEndpoint('incremental/ticket_events.json')
tickets.incremental = IncrementalEndpoint('incremental/tickets.json')
tickets.metrics = SecondaryEndpoint('tickets/%(id)s/metrics.json')
tickets.metrics.incremental = IncrementalEndpoint('incremental/ticket_metric_events.json')
tickets.organizations = SecondaryEndpoint('organizations/%(id)s/tickets.json')
tickets.recent = SecondaryEndpoint('tickets/recent.json')
tickets.tags = SecondaryEndpoint('tickets/%(id)s/tags.json')
tickets.macro = MultipleIDEndpoint('tickets/{0}/macros/{1}/apply.json')
tickets.merge = SecondaryEndpoint('tickets/%(id)s/merge.json')
tickets.skips = SecondaryEndpoint('tickets/%(id)s/skips.json')
topics = PrimaryEndpoint('topics')
dynamic_contents.variants.create = SecondaryEndpoint('dynamic_content/items/%(id)s/variants.json')
dynamic_contents.variants.create_many = SecondaryEndpoint('dynamic_content/items/%(id)s/variants/create_many.json')
dynamic_contents.variants.update = MultipleIDEndpoint('dynamic_content/items/{}/variants/{}.json')
dynamic_contents.variants.update_many = SecondaryEndpoint('dynamic_content/items/%(id)s/variants/update_many.json')
dynamic_contents.variants.delete = MultipleIDEndpoint('dynamic_content/items/{}/variants/{}.json')
end_user = SecondaryEndpoint('end_users/%(id)s.json')
group_memberships = PrimaryEndpoint('group_memberships')
group_memberships.assignable = PrimaryEndpoint('group_memberships/assignable')
group_memberships.make_default = MultipleIDEndpoint('users/{}/group_memberships/{}/make_default.json')
groups = PrimaryEndpoint('groups')
groups.memberships = SecondaryEndpoint('groups/%(id)s/memberships.json')
groups.memberships_assignable = SecondaryEndpoint('groups/%(id)s/memberships/assignable.json')
groups.users = SecondaryEndpoint('groups/%(id)s/users.json')
job_statuses = PrimaryEndpoint('job_statuses')
locales = PrimaryEndpoint('locales')
links = PrimaryEndpoint('services/jira/links')
macros = MacroEndpoint('macros')
macros.apply = SecondaryEndpoint('macros/%(id)s/apply.json')
nps = PrimaryEndpoint('nps')
nps.recipients_incremental = IncrementalEndpoint('nps/incremental/recipients.json')
nps.responses_incremental = IncrementalEndpoint('nps/incremental/responses.json')
organization_memberships = PrimaryEndpoint('organization_memberships')
organization_fields = PrimaryEndpoint('organization_fields')
organization_fields.reorder = PrimaryEndpoint('organization_fields/reorder.json')
organizations = PrimaryEndpoint('organizations')
organizations.external = SecondaryEndpoint('organizations/search.json?external_id=%(id)s')
organizations.incremental = IncrementalEndpoint('incremental/organizations.json')
organizations.organization_fields = PrimaryEndpoint('organization_fields')
organizations.organization_memberships = SecondaryEndpoint('organizations/%(id)s/organization_memberships.json')
organizations.requests = SecondaryEndpoint('organizations/%(id)s/requests.json')
organizations.tags = SecondaryEndpoint('organizations/%(id)s/tags.json')
dynamic_contents.variants.show = MultipleIDEndpoint('dynamic_content/items/{}/variants/{}.json')
dynamic_contents.variants.create = SecondaryEndpoint('dynamic_content/items/%(id)s/variants.json')
dynamic_contents.variants.create_many = SecondaryEndpoint('dynamic_content/items/%(id)s/variants/create_many.json')
dynamic_contents.variants.update = MultipleIDEndpoint('dynamic_content/items/{}/variants/{}.json')
dynamic_contents.variants.update_many = SecondaryEndpoint('dynamic_content/items/%(id)s/variants/update_many.json')
dynamic_contents.variants.delete = MultipleIDEndpoint('dynamic_content/items/{}/variants/{}.json')
end_user = SecondaryEndpoint('end_users/%(id)s.json')
group_memberships = PrimaryEndpoint('group_memberships')
group_memberships.assignable = PrimaryEndpoint('group_memberships/assignable')
group_memberships.make_default = MultipleIDEndpoint('users/{}/group_memberships/{}/make_default.json')
groups = PrimaryEndpoint('groups')
groups.memberships = SecondaryEndpoint('groups/%(id)s/memberships.json')
groups.memberships_assignable = SecondaryEndpoint('groups/%(id)s/memberships/assignable.json')
groups.users = SecondaryEndpoint('groups/%(id)s/users.json')
job_statuses = PrimaryEndpoint('job_statuses')
locales = PrimaryEndpoint('locales')
links = PrimaryEndpoint('services/jira/links')
macros = MacroEndpoint('macros')
macros.apply = SecondaryEndpoint('macros/%(id)s/apply.json')
nps = PrimaryEndpoint('nps')
nps.recipients_incremental = IncrementalEndpoint('nps/incremental/recipients.json')
nps.responses_incremental = IncrementalEndpoint('nps/incremental/responses.json')
organization_memberships = PrimaryEndpoint('organization_memberships')
organization_fields = PrimaryEndpoint('organization_fields')
organization_fields.reorder = PrimaryEndpoint('organization_fields/reorder.json')
organizations = PrimaryEndpoint('organizations')
organizations.external = SecondaryEndpoint('organizations/search.json?external_id=%(id)s')
organizations.incremental = IncrementalEndpoint('incremental/organizations.json')
organizations.organization_fields = PrimaryEndpoint('organization_fields')
organizations.organization_memberships = SecondaryEndpoint('organizations/%(id)s/organization_memberships.json')
organizations.requests = SecondaryEndpoint('organizations/%(id)s/requests.json')
nps.recipients_incremental = IncrementalEndpoint('nps/incremental/recipients.json')
nps.responses_incremental = IncrementalEndpoint('nps/incremental/responses.json')
organization_memberships = PrimaryEndpoint('organization_memberships')
organization_fields = PrimaryEndpoint('organization_fields')
organization_fields.reorder = PrimaryEndpoint('organization_fields/reorder.json')
organizations = PrimaryEndpoint('organizations')
organizations.external = SecondaryEndpoint('organizations/search.json?external_id=%(id)s')
organizations.incremental = IncrementalEndpoint('incremental/organizations.json')
organizations.organization_fields = PrimaryEndpoint('organization_fields')
organizations.organization_memberships = SecondaryEndpoint('organizations/%(id)s/organization_memberships.json')
organizations.requests = SecondaryEndpoint('organizations/%(id)s/requests.json')
organizations.tags = SecondaryEndpoint('organizations/%(id)s/tags.json')
organizations.create_or_update = PrimaryEndpoint('organizations/create_or_update')
organizations.users = SecondaryEndpoint('organizations/%(id)s/users.json')
requests = PrimaryEndpoint('requests')
requests.ccd = PrimaryEndpoint("requests/ccd")
requests.comments = SecondaryEndpoint('requests/%(id)s/comments.json')
requests.open = PrimaryEndpoint("requests/open")
requests.search = RequestSearchEndpoint('requests/search.json')
requests.solved = PrimaryEndpoint("requests/solved")
satisfaction_ratings = SatisfactionRatingEndpoint('satisfaction_ratings')
satisfaction_ratings.create = SecondaryEndpoint('tickets/%(id)s/satisfaction_rating.json')
schedules = PrimaryEndpoint('business_hours/schedules')
search = SearchEndpoint('search.json')
sharing_agreements = PrimaryEndpoint('sharing_agreements')
sla_policies = PrimaryEndpoint('slas/policies')
sla_policies.definitions = PrimaryEndpoint('slas/policies/definitions')
skips = PrimaryEndpoint('skips')
suspended_tickets = PrimaryEndpoint('suspended_tickets')
suspended_tickets.recover = SecondaryEndpoint('suspended_tickets/%(id)s/recover.json')
tags = PrimaryEndpoint('tags')
targets = PrimaryEndpoint('targets')
organizations.requests = SecondaryEndpoint('organizations/%(id)s/requests.json')
organizations.tags = SecondaryEndpoint('organizations/%(id)s/tags.json')
organizations.create_or_update = PrimaryEndpoint('organizations/create_or_update')
organizations.users = SecondaryEndpoint('organizations/%(id)s/users.json')
requests = PrimaryEndpoint('requests')
requests.ccd = PrimaryEndpoint("requests/ccd")
requests.comments = SecondaryEndpoint('requests/%(id)s/comments.json')
requests.open = PrimaryEndpoint("requests/open")
requests.search = RequestSearchEndpoint('requests/search.json')
requests.solved = PrimaryEndpoint("requests/solved")
satisfaction_ratings = SatisfactionRatingEndpoint('satisfaction_ratings')
satisfaction_ratings.create = SecondaryEndpoint('tickets/%(id)s/satisfaction_rating.json')
schedules = PrimaryEndpoint('business_hours/schedules')
search = SearchEndpoint('search.json')
sharing_agreements = PrimaryEndpoint('sharing_agreements')
sla_policies = PrimaryEndpoint('slas/policies')
sla_policies.definitions = PrimaryEndpoint('slas/policies/definitions')
skips = PrimaryEndpoint('skips')
suspended_tickets = PrimaryEndpoint('suspended_tickets')
suspended_tickets.recover = SecondaryEndpoint('suspended_tickets/%(id)s/recover.json')
tags = PrimaryEndpoint('tags')
targets = PrimaryEndpoint('targets')
ticket_fields = PrimaryEndpoint('ticket_fields')
ticket_field_options = SecondaryEndpoint('ticket_fields/%(id)s/options.json')
ticket_field_options.show = MultipleIDEndpoint('ticket_fields/{}/options/{}.json')
ticket_field_options.update = SecondaryEndpoint('ticket_fields/%(id)s/options.json')
ticket_field_options.delete = MultipleIDEndpoint('ticket_fields/{}/options/{}.json')
ticket_forms = PrimaryEndpoint('ticket_forms')
ticket_import = PrimaryEndpoint('imports/tickets')
ticket_metrics = PrimaryEndpoint('ticket_metrics')
ticket_metric_events = IncrementalEndpoint('incremental/ticket_metric_events.json')
tickets = PrimaryEndpoint('tickets')
tickets.metrics = SecondaryEndpoint('tickets/%(id)s/metrics.json')
tickets.metrics.incremental = IncrementalEndpoint('incremental/ticket_metric_events.json')
tickets.organizations = SecondaryEndpoint('organizations/%(id)s/tickets.json')
tickets.recent = SecondaryEndpoint('tickets/recent.json')
tickets.tags = SecondaryEndpoint('tickets/%(id)s/tags.json')
tickets.macro = MultipleIDEndpoint('tickets/{0}/macros/{1}/apply.json')
tickets.merge = SecondaryEndpoint('tickets/%(id)s/merge.json')
tickets.skips = SecondaryEndpoint('tickets/%(id)s/skips.json')
topics = PrimaryEndpoint('topics')
topics.tags = SecondaryEndpoint('topics/%(id)s/tags.json')
triggers = PrimaryEndpoint('triggers')
user_fields = PrimaryEndpoint('user_fields')
users = PrimaryEndpoint('users')
users.assigned = SecondaryEndpoint('users/%(id)s/tickets/assigned.json')
users.cced = SecondaryEndpoint('users/%(id)s/tickets/ccd.json')
users.create_or_update = PrimaryEndpoint('users/create_or_update')
users.create_or_update_many = PrimaryEndpoint('users/create_or_update_many.json')
users.group_memberships = SecondaryEndpoint('users/%(id)s/group_memberships.json')
users.deleted = PrimaryEndpoint("deleted_users")
users.groups = SecondaryEndpoint('users/%(id)s/groups.json')
users.incremental = IncrementalEndpoint('incremental/users.json')
users.me = PrimaryEndpoint('users/me')
users.merge = SecondaryEndpoint('users/%(id)s/merge.json')
users.organization_memberships = SecondaryEndpoint('users/%(id)s/organization_memberships.json')
users.organizations = SecondaryEndpoint('users/%(id)s/organizations.json')
users.related = SecondaryEndpoint('users/%(id)s/related.json')
users.requested = SecondaryEndpoint('users/%(id)s/tickets/requested.json')
users.requests = SecondaryEndpoint('users/%(id)s/requests.json')
users.tags = SecondaryEndpoint('users/%(id)s/tags.json')
users.set_password = SecondaryEndpoint('users/%(id)s/password.json')
users.identities = SecondaryEndpoint('users/%(id)s/identities.json')
users.identities.show = MultipleIDEndpoint('users/{0}/identities/{1}.json')