1# -*- coding: utf-8 -*-
2
3############################ Copyrights and license ############################
4#                                                                              #
5# Copyright 2013 AKFish <akfish@gmail.com>                                     #
6# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net>                 #
7# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net>                 #
8# Copyright 2016 Jakub Wilk <jwilk@jwilk.net>                                  #
9# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #
10# Copyright 2018 Maarten Fonville <mfonville@users.noreply.github.com>         #
11# Copyright 2018 Wan Liuyang <tsfdye@gmail.com>                                #
12# Copyright 2018 sfdye <tsfdye@gmail.com>                                      #
13# Copyright 2019 Nick Campbell <nicholas.j.campbell@gmail.com>                 #
14# Copyright 2020 Pascal Hofmann <mail@pascalhofmann.de>                        #
15#                                                                              #
16# This file is part of PyGithub.                                               #
17# http://pygithub.readthedocs.io/                                              #
18#                                                                              #
19# PyGithub is free software: you can redistribute it and/or modify it under    #
20# the terms of the GNU Lesser General Public License as published by the Free  #
21# Software Foundation, either version 3 of the License, or (at your option)    #
22# any later version.                                                           #
23#                                                                              #
24# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #
25# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #
26# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
27# details.                                                                     #
28#                                                                              #
29# You should have received a copy of the GNU Lesser General Public License     #
30# along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #
31#                                                                              #
32################################################################################
33
34
35REQ_IF_NONE_MATCH = "If-None-Match"
36REQ_IF_MODIFIED_SINCE = "If-Modified-Since"
37PROCESSING_202_WAIT_TIME = 2
38
39# ##############################################################################
40# Response Header                                                              #
41# (Lower Case)                                                                 #
42# ##############################################################################
43RES_ETAG = "etag"
44RES_LAST_MODIFIED = "last-modified"
45
46# Inspired by https://github.com/google/go-github
47
48# Headers
49
50headerRateLimit = "x-ratelimit-limit"
51headerRateRemaining = "x-ratelimit-remaining"
52headerRateReset = "x-ratelimit-reset"
53headerOAuthScopes = "x-oauth-scopes"
54headerOTP = "x-github-otp"
55
56defaultMediaType = "application/octet-stream"
57
58# Custom media type for preview API
59
60# https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/
61mediaTypeStarringPreview = "application/vnd.github.v3.star+json"
62
63# https://developer.github.com/changes/2016-02-19-source-import-preview-api/
64mediaTypeImportPreview = "application/vnd.github.barred-rock-preview"
65
66# https://developer.github.com/changes/2016-05-12-reactions-api-preview/
67mediaTypeReactionsPreview = "application/vnd.github.squirrel-girl-preview"
68
69# https://developer.github.com/changes/2016-09-14-Integrations-Early-Access/
70mediaTypeIntegrationPreview = "application/vnd.github.machine-man-preview+json"
71
72# https://developer.github.com/changes/2016-09-14-projects-api/
73mediaTypeProjectsPreview = "application/vnd.github.inertia-preview+json"
74
75# https://developer.github.com/changes/2017-01-05-commit-search-api/
76mediaTypeCommitSearchPreview = "application/vnd.github.cloak-preview"
77
78# https://developer.github.com/changes/2017-02-28-user-blocking-apis-and-webhook/
79mediaTypeBlockUsersPreview = "application/vnd.github.giant-sentry-fist-preview+json"
80
81# https://developer.github.com/changes/2017-07-17-update-topics-on-repositories/
82mediaTypeTopicsPreview = "application/vnd.github.mercy-preview+json"
83
84# https://developer.github.com/changes/2018-02-22-label-description-search-preview/
85mediaTypeLabelDescriptionSearchPreview = "application/vnd.github.symmetra-preview+json"
86
87# https://developer.github.com/changes/2018-01-10-lock-reason-api-preview/
88mediaTypeLockReasonPreview = "application/vnd.github.sailor-v-preview+json"
89
90# https://developer.github.com/changes/2018-01-25-organization-invitation-api-preview/
91mediaTypeOrganizationInvitationPreview = "application/vnd.github.dazzler-preview+json"
92
93# https://developer.github.com/changes/2018-02-07-team-discussions-api
94mediaTypeTeamDiscussionsPreview = "application/vnd.github.echo-preview+json"
95
96# https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews/
97mediaTypeRequireMultipleApprovingReviews = (
98    "application/vnd.github.luke-cage-preview+json"
99)
100
101# https://developer.github.com/changes/2018-05-24-user-migration-api/
102mediaTypeMigrationPreview = "application/vnd.github.wyandotte-preview+json"
103
104# https://developer.github.com/v3/search/#highlighting-code-search-results-1
105highLightSearchPreview = "application/vnd.github.v3.text-match+json"
106
107# https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures/
108signaturesProtectedBranchesPreview = "application/vnd.github.zzzax-preview+json"
109
110# https://developer.github.com/changes/2019-04-24-vulnerability-alerts/
111vulnerabilityAlertsPreview = "application/vnd.github.dorian-preview+json"
112
113# https://developer.github.com/changes/2019-06-04-automated-security-fixes/
114automatedSecurityFixes = "application/vnd.github.london-preview+json"
115
116# https://developer.github.com/changes/2019-05-29-update-branch-api/
117updateBranchPreview = "application/vnd.github.lydian-preview+json"
118
119# https://developer.github.com/changes/2016-05-23-timeline-preview-api/
120issueTimelineEventsPreview = "application/vnd.github.mockingbird-preview"
121
122# https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository
123teamRepositoryPermissions = "application/vnd.github.v3.repository+json"
124
125# https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements/
126deploymentEnhancementsPreview = "application/vnd.github.ant-man-preview+json"
127
128# https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/
129deploymentStatusEnhancementsPreview = "application/vnd.github.flash-preview+json"
130