text stringlengths 81 112k |
|---|
Provide vendors info
:param limit:
:param offset:
:return:
def get_vendors_info(self, limit=10, offset=10):
"""
Provide vendors info
:param limit:
:param offset:
:return:
"""
params = {}
if offset:
params['offset'] = of... |
Information about applications
:param limit:
:param offset:
:return:
def get_application_info(self, limit=10, offset=10):
"""
Information about applications
:param limit:
:param offset:
:return:
"""
params = {}
if offset:
... |
Provide the project list
:param limit: OPTIONAL 25 is default
:return:
def project_list(self, limit=None):
"""
Provide the project list
:param limit: OPTIONAL 25 is default
:return:
"""
params = {}
if limit:
params['limit'] = limit
... |
Provide project info
:param key:
:return:
def project(self, key):
"""
Provide project info
:param key:
:return:
"""
url = 'rest/api/1.0/projects/{0}'.format(key)
return (self.get(url) or {}).get('values') |
Create project
:param key:
:param name:
:param description:
:return:
def create_project(self, key, name, description=""):
"""
Create project
:param key:
:param name:
:param description:
:return:
"""
url = 'rest/api/1.0/proj... |
Get project administrators for project
:param key: project key
:return: project administrators
def project_users_with_administrator_permissions(self, key):
"""
Get project administrators for project
:param key: project key
:return: project administrators
"""
... |
Get Project Groups
:param key:
:param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:param filter_str: OPTIONAL: group filter string
:return:
def project_groups(s... |
Get repository Groups
:param project_key:
:param repo_key:
:param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:param filter_str: OPTIONAL: group filter string
... |
Get group of members
:param group:
:param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:return:
def group_members(self, group, limit=99999):
"""
Get group of ... |
Get the list of project administrators
:return:
def all_project_administrators(self):
"""
Get the list of project administrators
:return:
"""
for project in self.project_list():
log.info('Processing project: {0} - {1}'.format(project.get('key'), project.get('... |
Get repositories list from project
:param project_key:
:param start: OPTIONAL: The start of the
:param limit: OPTIONAL: The limit of the number of repositories to return, this may be restricted by
fixed system limits. Default by built-in method: 25
:return:
def r... |
Create a new repository.
Requires an existing project in which this repository will be created. The only parameters which will be used
are name and scmId.
The authenticated user must have PROJECT_ADMIN permission for the context project to call this resource.
:param project_key: The p... |
Get all repositories list from project
:param project_key:
:return:
def repo_all_list(self, project_key):
"""
Get all repositories list from project
:param project_key:
:return:
"""
url = 'rest/api/1.0/projects/{projectKey}/repos'.format(projectKey=projec... |
Retrieve the branches matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param start:
:param project:
:param repository:
:param base: base branch/tag to compare each branch to (for the... |
Creates a branch using the information provided in the request.
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project_key: The project matching the projectKey supplied in the resource path as shown in URL.
:type project_key: str... |
Delete branch from related repo
:param self:
:param project:
:param repository:
:param name:
:param end_point:
:return:
def delete_branch(self, project, repository, name, end_point):
"""
Delete branch from related repo
:param self:
:param ... |
Get pull requests
:param project:
:param repository:
:param state:
:param order: OPTIONAL: defaults to NEWEST) the order to return pull requests in, either OLDEST
(as in: "oldest first") or NEWEST.
:param limit:
:param start:
:retur... |
Get pull requests activities
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:return:
def get_pull_requests_activities(self, project, repository, pull_request_id):
"""
Get pull requests activities
:param... |
Get pull requests changes
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:return:
def get_pull_requests_changes(self, project, repository, pull_request_id):
"""
Get pull requests changes
:param project:... |
Get pull requests commits
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:return:
def get_pull_requests_commits(self, project, repository, pull_request_id):
"""
Get pull requests commits
:param project:... |
Add comment into pull request
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:param text comment text
:return:
def add_pull_request_comment(self, project, repository, pull_request_id, text):
"""
Add com... |
Retrieve a pull request.
The authenticated user must have REPO_READ permission
for the repository that this pull request targets to call this resource.
:param project:
:param repository:
:param pull_request_id: the ID of the pull request within the repository
:return:
de... |
Retrieve the tags matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
:param project:
:param repository:
:param filter:
:param start:
:param limit: OPTIONAL: The limit of the numbe... |
Retrieve a tag in the specified repository.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
Search uri is api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags/{name:.*}
:param project:
:param repository:
:param tag_name... |
Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project:
:param repository:
:param tag_name:
:param commit_revision: commit has... |
Creates a tag using the information provided in the {@link RestCreateTagRequest request}
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
:param project:
:param repository:
:param tag_name:
:return:
def delete_tag(self, pro... |
Get commit list from repo
:param project:
:param repository:
:param hash_oldest:
:param hash_newest:
:param limit: OPTIONAL: The limit of the number of commits to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:retu... |
Retrieve a single commit identified by its ID>. In general, that ID is a SHA1.
From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param project:
... |
Get change log between 2 refs
:param project:
:param repository:
:param ref_from:
:param ref_to:
:param limit: OPTIONAL: The limit of the number of changes to return, this may be restricted by
fixed system limits. Default by built-in method: 99999
:return:... |
Retrieve a page of files from particular directory of a repository.
The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param pr... |
Retrieve the raw content for a file path at a specified revision.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
:param project:
:param repository:
:param filename:
:param at: OPTIONAL ref string
:param markup: i... |
Get branches permissions from a given repo
:param project:
:param repository:
:param limit:
:return:
def get_branches_permissions(self, project, repository, limit=25):
"""
Get branches permissions from a given repo
:param project:
:param repository:
... |
Reindex all of the Jira issues related to this repository, including branches and pull requests.
This automatically happens as part of an upgrade, and calling this manually should only be required
if something unforeseen happens and the index becomes out of sync.
The authenticated user must have... |
Forks a repository within the same project.
:param project:
:param repository:
:param new_repository:
:return:
def fork_repository(self, project, repository, new_repository):
"""
Forks a repository within the same project.
:param project:
:param repositor... |
Get branching model
:param project:
:param repository:
:return:
def get_branching_model(self, project, repository):
"""
Get branching model
:param project:
:param repository:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{project}/rep... |
Set branching model
:param project:
:param repository:
:param data:
:return:
def set_branching_model(self, project, repository, data):
"""
Set branching model
:param project:
:param repository:
:param data:
:return:
"""
url... |
Enable branching model by setting it with default configuration
:param project:
:param repository:
:return:
def enable_branching_model(self, project, repository):
"""
Enable branching model by setting it with default configuration
:param project:
:param repositor... |
Disable branching model
:param project:
:param repository:
:return:
def disable_branching_model(self, project, repository):
"""
Disable branching model
:param project:
:param repository:
:return:
"""
url = 'rest/branch-utils/1.0/projects/{... |
Get request based on the python-requests module. You can override headers, and also, get not json response
:param path:
:param data:
:param flags:
:param params:
:param headers:
:param not_json_response: OPTIONAL: For get content from raw requests packet
:return:
... |
Deletes resources at given paths.
:rtype: dict
:return: Empty dictionary to have consistent interface.
Some of Atlassian REST resources don't return any content.
def delete(self, path, data=None, headers=None, params=None):
"""
Deletes resources at given paths.
:rtype: d... |
Detect errors in space
:param confluence:
:param space_key:
:return:
def check_unknown_attachment_in_space(confluence, space_key):
"""
Detect errors in space
:param confluence:
:param space_key:
:return:
"""
page_ids = get_all_pages_ids(confluence, space_key)
prin... |
Get all found pages with order by created date
:param confluence:
:param word:
:return: json answer
def search_word(confluence, word):
"""
Get all found pages with order by created date
:param confluence:
:param word:
:return: json answer
"""
cql = "siteSearch ~ {} ord... |
Get all found pages with order by created date
:param confluence:
:param space
:param word:
:return: json answer
def search_word_in_space(confluence, space, word):
"""
Get all found pages with order by created date
:param confluence:
:param space
:param word:
:return: ... |
Remove all pages from trash for related space
:param limit:
:param confluence:
:param space_key:
:return:
def clean_pages_from_space(confluence, space_key, limit=500):
"""
Remove all pages from trash for related space
:param limit:
:param confluence:
:param space_key:
:return:
... |
Main function for retrieve space keys and provide space for cleaner
:param confluence:
:return:
def clean_all_trash_pages_from_all_spaces(confluence):
"""
Main function for retrieve space keys and provide space for cleaner
:param confluence:
:return:
"""
limit = 50
flag = True
i... |
:param confluence:
:param space_key:
:return:
def get_all_page_ids_from_space(confluence, space_key):
"""
:param confluence:
:param space_key:
:return:
"""
limit = 500
flag = True
step = 0
page_ids = []
while flag:
values = confluence.get_all_pages_from_space(sp... |
Threshold used to determine if your content qualifies as spam.
On a scale from 1 to 10, with 10 being most strict, or most likely to
be considered as spam.
:param value: Threshold used to determine if your content qualifies as
spam.
On a scale from 1 ... |
An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent here.
:param value: An Inbound Parse URL to send a copy of your email.
If defined, a copy of your email and its spam report will be sent here.
:type value: string
def po... |
Get a JSON-ready representation of this SpamCheck.
:returns: This SpamCheck, ready for use in a request body.
:rtype: dict
def get(self):
"""
Get a JSON-ready representation of this SpamCheck.
:returns: This SpamCheck, ready for use in a request body.
:rtype: dict
... |
The actual HTML content.
:param value: The actual HTML content.
:type value: string
def content(self, value):
"""The actual HTML content.
:param value: The actual HTML content.
:type value: string
"""
self._validator.validate_message_dict(value)
self._c... |
Get a JSON-ready representation of this HtmlContent.
:returns: This HtmlContent, ready for use in a request body.
:rtype: dict
def get(self):
"""
Get a JSON-ready representation of this HtmlContent.
:returns: This HtmlContent, ready for use in a request body.
:rtype: d... |
Get a JSON-ready representation of this BCCSettings.
:returns: This BCCSettings, ready for use in a request body.
:rtype: dict
def get(self):
"""
Get a JSON-ready representation of this BCCSettings.
:returns: This BCCSettings, ready for use in a request body.
:rtype: d... |
Set the default header for a Twilio SendGrid v3 API call
def _default_headers(self):
"""Set the default header for a Twilio SendGrid v3 API call"""
headers = {
"Authorization": 'Bearer {}'.format(self.api_key),
"User-agent": self.useragent,
"Accept": 'applicatio... |
Make a Twilio SendGrid v3 API request with the request body generated by
the Mail object
:param message: The Twilio SendGrid v3 API request body generated by the Mail
object
:type message: Mail
def send(self, message):
"""Make a Twilio SendGrid v3 API r... |
Ensure an item is appended to a list or create a new empty list
:param new_items: the item(s) to append
:type new_items: list(obj)
:param append_to: the list on which to append the items
:type append_to: list()
:param index: index of the list on which to append the items
... |
Ensure an item is inserted to a list or create a new empty list
:param new_items: the item(s) to insert
:type new_items: list(obj)
:param insert_to: the list on which to insert the items at index 0
:type insert_to: list()
def _ensure_insert(self, new_items, insert_to):
"""Ensur... |
Flatten a dict
:param dicts: Flatten a dict
:type dicts: list(dict)
def _flatten_dicts(self, dicts):
"""Flatten a dict
:param dicts: Flatten a dict
:type dicts: list(dict)
"""
d = dict()
list_of_dicts = [d.get() for d in dicts or []]
return {k: ... |
Adds emails to the Personalization object
:param emails: An Email or list of Email objects
:type emails: Email, list(Email)
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization f... |
Add a Personaliztion object
:param personalizations: Add a Personalization object
:type personalizations: Personalization
:param index: The index where to add the Personalization
:type index: int
def add_personalization(self, personalization, index=0):
"""Add a Personaliztion o... |
Adds To objects to the Personalization object
:param to_emails: An To or list of To objects
:type to_emails: To, list(To), str, tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personi... |
Adds a To object to the Personalization object
:param to_emails: A To object
:type to_emails: To, str, tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization for each recipie... |
Adds Cc objects to the Personalization object
:param cc_emails: An Cc or list of Cc objects
:type cc_emails: Cc, list(Cc), tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilizat... |
Adds a Cc object to the Personalization object
:param to_emails: An Cc object
:type to_emails: Cc
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization for each recipient
... |
Adds Bcc objects to the Personalization object
:param bcc_emails: An Bcc or list of Bcc objects
:type bcc_emails: Bcc, list(Bcc), tuple
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new perso... |
Adds a Bcc object to the Personalization object
:param to_emails: An Bcc object
:type to_emails: Bcc
:param global_substitutions: A dict of substitutions for all recipients
:type global_substitutions: dict
:param is_multiple: Create a new personilization for each recipient
... |
The subject of the email(s)
:param value: The subject of the email(s)
:type value: Subject, string
def subject(self, value):
"""The subject of the email(s)
:param value: The subject of the email(s)
:type value: Subject, string
"""
if isinstance(value, Subject):... |
Add headers to the email
:param value: A list of Header objects or a dict of header key/values
:type value: Header, list(Header), dict
def header(self, headers):
"""Add headers to the email
:param value: A list of Header objects or a dict of header key/values
:type value: Head... |
Add headers to the email globaly or to a specific Personalization
:param value: A Header object or a dict of header key/values
:type value: Header, dict
def add_header(self, header):
"""Add headers to the email globaly or to a specific Personalization
:param value: A Header object or ... |
Add substitutions to the email
:param value: Add substitutions to the email
:type value: Substitution, list(Substitution)
def substitution(self, substitution):
"""Add substitutions to the email
:param value: Add substitutions to the email
:type value: Substitution, list(Substi... |
Add a substitution to the email
:param value: Add a substitution to the email
:type value: Substitution
def add_substitution(self, substitution):
"""Add a substitution to the email
:param value: Add a substitution to the email
:type value: Substitution
"""
if s... |
Add custom args to the email
:param value: A list of CustomArg objects or a dict of custom arg
key/values
:type value: CustomArg, list(CustomArg), dict
def custom_arg(self, custom_arg):
"""Add custom args to the email
:param value: A list of CustomArg objects or ... |
Add custom args to the email globaly or to a specific Personalization
:param value: A CustomArg object or a dict of custom arg key/values
:type value: CustomArg, dict
def add_custom_arg(self, custom_arg):
"""Add custom args to the email globaly or to a specific Personalization
:param ... |
A unix timestamp specifying when your email should
be delivered.
:param value: A unix timestamp specifying when your email should
be delivered.
:type value: SendAt, int
def send_at(self, value):
"""A unix timestamp specifying when your email should
be delivered.
... |
Data for a transactional template
:param value: Data for a transactional template
:type value: DynamicTemplateData, a JSON-serializeable structure
def dynamic_template_data(self, value):
"""Data for a transactional template
:param value: Data for a transactional template
:type... |
The email address of the sender
:param value: The email address of the sender
:type value: From, str, tuple
def from_email(self, value):
"""The email address of the sender
:param value: The email address of the sender
:type value: From, str, tuple
"""
if isinst... |
The reply to email address
:param value: The reply to email address
:type value: ReplyTo, str, tuple
def reply_to(self, value):
"""The reply to email address
:param value: The reply to email address
:type value: ReplyTo, str, tuple
"""
if isinstance(value, str)... |
The content(s) of the email
:param contents: The content(s) of the email
:type contents: Content, list(Content)
def content(self, contents):
"""The content(s) of the email
:param contents: The content(s) of the email
:type contents: Content, list(Content)
"""
i... |
Add content to the email
:param contents: Content to be added to the email
:type contents: Content
:param mime_type: Override the mime type
:type mime_type: MimeType, str
def add_content(self, content, mime_type=None):
"""Add content to the email
:param contents: Conte... |
Add attachment(s) to this email
:param attachment: Add attachment(s) to this email
:type attachment: Attachment, list(Attachment)
def attachment(self, attachment):
"""Add attachment(s) to this email
:param attachment: Add attachment(s) to this email
:type attachment: Attachmen... |
Add an attachment to this email
:param attachment: Add an attachment to this email
:type attachment: Attachment
def add_attachment(self, attachment):
"""Add an attachment to this email
:param attachment: Add an attachment to this email
:type attachment: Attachment
"""
... |
The transactional template id for this email
:param value: The transactional template id for this email
:type value: TemplateId
def template_id(self, value):
"""The transactional template id for this email
:param value: The transactional template id for this email
:type value:... |
The block sections of code to be used as substitutions
:rtype: Section, list(Section)
def section(self, section):
"""The block sections of code to be used as substitutions
:rtype: Section, list(Section)
"""
if isinstance(section, list):
for h in section:
... |
A block section of code to be used as substitutions
:param section: A block section of code to be used as substitutions
:type section: Section
def add_section(self, section):
"""A block section of code to be used as substitutions
:param section: A block section of code to be used as s... |
Add categories assigned to this message
:rtype: list(Category)
def category(self, categories):
"""Add categories assigned to this message
:rtype: list(Category)
"""
if isinstance(categories, list):
for c in categories:
self.add_category(c)
e... |
Add a category assigned to this message
:rtype: Category
def add_category(self, category):
"""Add a category assigned to this message
:rtype: Category
"""
self._categories = self._ensure_append(category, self._categories) |
Get a JSON-ready representation of this Mail object.
:returns: This Mail object, ready for use in a request body.
:rtype: dict
def get(self):
"""
Get a JSON-ready representation of this Mail object.
:returns: This Mail object, ready for use in a request body.
:rtype: d... |
Create a Mail object from an instance of
email.message.EmailMessage.
:type message: email.message.EmailMessage
:rtype: Mail
def from_EmailMessage(cls, message):
"""Create a Mail object from an instance of
email.message.EmailMessage.
:type message: email.message.EmailMe... |
Get a JSON-ready representation of this Ganalytics.
:returns: This Ganalytics, ready for use in a request body.
:rtype: dict
def get(self):
"""
Get a JSON-ready representation of this Ganalytics.
:returns: This Ganalytics, ready for use in a request body.
:rtype: dict
... |
Get a JSON-ready representation of this FooterSettings.
:returns: This FooterSettings, ready for use in a request body.
:rtype: dict
def get(self):
"""
Get a JSON-ready representation of this FooterSettings.
:returns: This FooterSettings, ready for use in a request body.
... |
Name associated with this email.
:param value: Name associated with this email.
:type value: string
def name(self, value):
"""Name associated with this email.
:param value: Name associated with this email.
:type value: string
"""
if not (value is None or isinst... |
Allows passing emails as "Example Name <example@example.com>"
:param email_info: Allows passing emails as
"Example Name <example@example.com>"
:type email_info: string
def parse_email(self, email_info):
"""Allows passing emails as "Example Name <example@example.com>"... |
Get a JSON-ready representation of this Email.
:returns: This Email, ready for use in a request body.
:rtype: dict
def get(self):
"""
Get a JSON-ready representation of this Email.
:returns: This Email, ready for use in a request body.
:rtype: dict
"""
... |
An array containing the unsubscribe groups that you would like to be
displayed on the unsubscribe preferences page.
:param value: An array containing the unsubscribe groups that you
would like to be displayed on the unsubscribe
preferences page.
:type... |
The unsubscribe group to associate with this email.
:param value: ID of an unsubscribe group
:type value: GroupId, int, required
def group_id(self, value):
"""The unsubscribe group to associate with this email.
:param value: ID of an unsubscribe group
:type value: GroupId, int... |
An array containing the unsubscribe groups that you would like to
be displayed on the unsubscribe preferences page. Max of 25 groups.
:param groups_to_display: Unsubscribe groups to display
:type groups_to_display: GroupsToDisplay, list(int), optional
def groups_to_display(self, value):
... |
Get a JSON-ready representation of this ASM object.
:returns: This ASM object, ready for use in a request body.
:rtype: dict
def get(self):
"""
Get a JSON-ready representation of this ASM object.
:returns: This ASM object, ready for use in a request body.
:rtype: dict
... |
With the JSON dict that will be sent to SendGrid's API,
check the content for SendGrid API keys - throw exception if found.
:param request_body: The JSON dict that will be sent to SendGrid's
API.
:type request_body: JSON serializable structure
... |
With a message string, check to see if it contains a SendGrid API Key
If a key is found, throw an exception
:param message_string: message that will be sent
:type message_string: string
:raises ApiKeyIncludedException: If message_string matches a regex
... |
Get a dict of personalization mock.
def get_mock_personalization_dict():
"""Get a dict of personalization mock."""
mock_pers = dict()
mock_pers['to_list'] = [To("test1@example.com",
"Example User"),
To("test2@example.com",
... |
Build attachment mock. Make sure your content is base64 encoded before passing into attachment.content.
Another example: https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/attachment.md
def build_attachment1():
"""Build attachment mock. Make sure your content is base64 encoded before passing int... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.