MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / create_card

Method create_card

github/ProjectColumn.py:140–163  ·  view source on GitHub ↗

:calls: `POST /projects/columns/{column_id}/cards `_

(
        self,
        note: Opt[str] = NotSet,
        content_id: Opt[int] = NotSet,
        content_type: Opt[str] = NotSet,
    )

Source from the content-addressed store, hash-verified

138 )
139
140 def create_card(
141 self,
142 note: Opt[str] = NotSet,
143 content_id: Opt[int] = NotSet,
144 content_type: Opt[str] = NotSet,
145 ) -> github.ProjectCard.ProjectCard:
146 """
147 :calls: `POST /projects/columns/{column_id}/cards <https://docs.github.com/en/rest/reference/projects#create-a-project-card>`_
148 """
149 if isinstance(note, str):
150 assert content_id is NotSet, content_id
151 assert content_type is NotSet, content_type
152 post_parameters: dict[str, Any] = {"note": note}
153 else:
154 assert note is NotSet, note
155 assert isinstance(content_id, int), content_id
156 assert isinstance(content_type, str), content_type
157 post_parameters = {"content_id": content_id, "content_type": content_type}
158
159 import_header = {"Accept": Consts.mediaTypeProjectsPreview}
160 headers, data = self._requester.requestJsonAndCheck(
161 "POST", f"{self.url}/cards", headers=import_header, input=post_parameters
162 )
163 return github.ProjectCard.ProjectCard(self._requester, headers, data)
164
165 def move(self, position: str) -> bool:
166 """

Callers 6

testCreateCardMethod · 0.80
testCreateWithNoteMethod · 0.80
testCreateFromIssueMethod · 0.80
testEditNoteMethod · 0.80
testEditArchivedMethod · 0.80

Calls 1

requestJsonAndCheckMethod · 0.80

Tested by

no test coverage detected