@@ -514,6 +514,30 @@ def create_commit(self, message, tree, parents, author={}, committer={}):
514
514
json = self ._json (self ._post (url ,data = data ),201 )
515
515
return Commit (json ,self )if json else None
516
516
517
+ @requires_auth
518
+ def create_deployment (self ,ref ,force = False ,payload = '' ,
519
+ auto_merge = False ,description = '' ):
520
+ """Create a deployment.
521
+
522
+ :param str ref: (required), The ref to deploy. This can be a branch,
523
+ tag, or sha.
524
+ :param bool force: Optional parameter to bypass any ahead/behind
525
+ checks or commit status checks. Default: False
526
+ :param str payload: Optional JSON payload with extra information about
527
+ the deployment. Default: ""
528
+ :param bool auto_merge: Optional parameter to merge the default branch
529
+ into the requested deployment branch if necessary. Default: False
530
+ :param str description: Optional short description. Default: ""
531
+ :returns: :class:`Deployment <github3.repos.deployment.Deployment>`
532
+ """
533
+ json = None
534
+ if ref :
535
+ url = self ._build_url ('deployments' ,base_url = self ._api )
536
+ data = {'ref' :ref ,'force' :force ,'payload' :payload ,
537
+ 'auto_merge' :auto_merge ,'description' :description }
538
+ json = self ._json (self ._post (url ,data = data ),201 )
539
+ return Deployment (json ,self )if json else None
540
+
517
541
@requires_auth
518
542
def create_file (self ,path ,message ,content ,branch = None ,
519
543
committer = None ,author = None ):