From 30802e07b2d84fbc213b490d3402707dffe60096 Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Mon, 10 Apr 2017 21:18:42 +0100 Subject: update dependencies --- .../google/go-github/github/repos_deployments.go | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'vendor/github.com/google/go-github/github/repos_deployments.go') diff --git a/vendor/github.com/google/go-github/github/repos_deployments.go b/vendor/github.com/google/go-github/github/repos_deployments.go index ad931af..9054ca9 100644 --- a/vendor/github.com/google/go-github/github/repos_deployments.go +++ b/vendor/github.com/google/go-github/github/repos_deployments.go @@ -6,6 +6,7 @@ package github import ( + "context" "encoding/json" "fmt" ) @@ -61,7 +62,7 @@ type DeploymentsListOptions struct { // ListDeployments lists the deployments of a repository. // // GitHub API docs: https://developer.github.com/v3/repos/deployments/#list-deployments -func (s *RepositoriesService) ListDeployments(owner, repo string, opt *DeploymentsListOptions) ([]*Deployment, *Response, error) { +func (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo string, opt *DeploymentsListOptions) ([]*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) u, err := addOptions(u, opt) if err != nil { @@ -74,7 +75,7 @@ func (s *RepositoriesService) ListDeployments(owner, repo string, opt *Deploymen } var deployments []*Deployment - resp, err := s.client.Do(req, &deployments) + resp, err := s.client.Do(ctx, req, &deployments) if err != nil { return nil, resp, err } @@ -85,7 +86,7 @@ func (s *RepositoriesService) ListDeployments(owner, repo string, opt *Deploymen // GetDeployment returns a single deployment of a repository. // // GitHub API docs: https://developer.github.com/v3/repos/deployments/#get-a-single-deployment -func (s *RepositoriesService) GetDeployment(owner, repo string, deploymentID int) (*Deployment, *Response, error) { +func (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo string, deploymentID int) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v", owner, repo, deploymentID) req, err := s.client.NewRequest("GET", u, nil) @@ -94,7 +95,7 @@ func (s *RepositoriesService) GetDeployment(owner, repo string, deploymentID int } deployment := new(Deployment) - resp, err := s.client.Do(req, deployment) + resp, err := s.client.Do(ctx, req, deployment) if err != nil { return nil, resp, err } @@ -105,7 +106,7 @@ func (s *RepositoriesService) GetDeployment(owner, repo string, deploymentID int // CreateDeployment creates a new deployment for a repository. // // GitHub API docs: https://developer.github.com/v3/repos/deployments/#create-a-deployment -func (s *RepositoriesService) CreateDeployment(owner, repo string, request *DeploymentRequest) (*Deployment, *Response, error) { +func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo string, request *DeploymentRequest) (*Deployment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments", owner, repo) req, err := s.client.NewRequest("POST", u, request) @@ -117,7 +118,7 @@ func (s *RepositoriesService) CreateDeployment(owner, repo string, request *Depl req.Header.Set("Accept", mediaTypeDeploymentStatusPreview) d := new(Deployment) - resp, err := s.client.Do(req, d) + resp, err := s.client.Do(ctx, req, d) if err != nil { return nil, resp, err } @@ -153,7 +154,7 @@ type DeploymentStatusRequest struct { // ListDeploymentStatuses lists the statuses of a given deployment of a repository. // // GitHub API docs: https://developer.github.com/v3/repos/deployments/#list-deployment-statuses -func (s *RepositoriesService) ListDeploymentStatuses(owner, repo string, deployment int, opt *ListOptions) ([]*DeploymentStatus, *Response, error) { +func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int, opt *ListOptions) ([]*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) u, err := addOptions(u, opt) if err != nil { @@ -166,7 +167,7 @@ func (s *RepositoriesService) ListDeploymentStatuses(owner, repo string, deploym } var statuses []*DeploymentStatus - resp, err := s.client.Do(req, &statuses) + resp, err := s.client.Do(ctx, req, &statuses) if err != nil { return nil, resp, err } @@ -177,7 +178,7 @@ func (s *RepositoriesService) ListDeploymentStatuses(owner, repo string, deploym // GetDeploymentStatus returns a single deployment status of a repository. // // GitHub API docs: https://developer.github.com/v3/repos/deployments/#get-a-single-deployment-status -func (s *RepositoriesService) GetDeploymentStatus(owner, repo string, deploymentID, deploymentStatusID int) (*DeploymentStatus, *Response, error) { +func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, repo string, deploymentID, deploymentStatusID int) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses/%v", owner, repo, deploymentID, deploymentStatusID) req, err := s.client.NewRequest("GET", u, nil) @@ -189,7 +190,7 @@ func (s *RepositoriesService) GetDeploymentStatus(owner, repo string, deployment req.Header.Set("Accept", mediaTypeDeploymentStatusPreview) d := new(DeploymentStatus) - resp, err := s.client.Do(req, d) + resp, err := s.client.Do(ctx, req, d) if err != nil { return nil, resp, err } @@ -200,7 +201,7 @@ func (s *RepositoriesService) GetDeploymentStatus(owner, repo string, deployment // CreateDeploymentStatus creates a new status for a deployment. // // GitHub API docs: https://developer.github.com/v3/repos/deployments/#create-a-deployment-status -func (s *RepositoriesService) CreateDeploymentStatus(owner, repo string, deployment int, request *DeploymentStatusRequest) (*DeploymentStatus, *Response, error) { +func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, repo string, deployment int, request *DeploymentStatusRequest) (*DeploymentStatus, *Response, error) { u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment) req, err := s.client.NewRequest("POST", u, request) @@ -212,7 +213,7 @@ func (s *RepositoriesService) CreateDeploymentStatus(owner, repo string, deploym req.Header.Set("Accept", mediaTypeDeploymentStatusPreview) d := new(DeploymentStatus) - resp, err := s.client.Do(req, d) + resp, err := s.client.Do(ctx, req, d) if err != nil { return nil, resp, err } -- cgit v1.2.3