from resolver import pattern from patterns import Secret from .http_header_private import HttpHeadersPrivate @pattern(name="GitHub_Headers_Private") class GithubHeadersPrivate(HttpHeadersPrivate): """ Represents a set of HTTP headers with common values for authentication, content type, accept, user agent, API key, and host. The headers are stored in a dictionary, and any header values that are empty strings are filtered out. """ def __init__( self, auth: Secret, accept: str = "application/vnd.github+json", api_version: str = "2022-11-28", ): self.headers = { "Authorization": auth, "Accept": accept, "X-GitHub-Api-Version": api_version, } self.headers = {k: v for k, v in self.headers.items() if v}