@@ -24,12 +24,17 @@ type DeploymentBranchPolicyResponse struct {
2424 BranchPolicies []* DeploymentBranchPolicy `json:"branch_policies,omitempty"`
2525}
2626
27- // DeploymentBranchPolicyRequest represents a deployment branch policy request .
28- type DeploymentBranchPolicyRequest struct {
29- Name * string `json:"name,omitempty "`
27+ // CreateDeploymentBranchPolicyRequest represents a request to create a deployment branch policy.
28+ type CreateDeploymentBranchPolicyRequest struct {
29+ Name string `json:"name"`
3030 Type * string `json:"type,omitempty"`
3131}
3232
33+ // UpdateDeploymentBranchPolicyRequest represents a request to update a deployment branch policy.
34+ type UpdateDeploymentBranchPolicyRequest struct {
35+ Name string `json:"name"`
36+ }
37+
3338// ListDeploymentBranchPolicies lists the deployment branch policies for an environment.
3439//
3540// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#list-deployment-branch-policies
@@ -83,7 +88,7 @@ func (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, own
8388// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#create-a-deployment-branch-policy
8489//
8590//meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies
86- func (s * RepositoriesService ) CreateDeploymentBranchPolicy (ctx context.Context , owner , repo , environment string , body * DeploymentBranchPolicyRequest ) (* DeploymentBranchPolicy , * Response , error ) {
91+ func (s * RepositoriesService ) CreateDeploymentBranchPolicy (ctx context.Context , owner , repo , environment string , body CreateDeploymentBranchPolicyRequest ) (* DeploymentBranchPolicy , * Response , error ) {
8792 u := fmt .Sprintf ("repos/%v/%v/environments/%v/deployment-branch-policies" , owner , repo , environment )
8893
8994 req , err := s .client .NewRequest (ctx , "POST" , u , body )
@@ -105,7 +110,7 @@ func (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context,
105110// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies?apiVersion=2022-11-28#update-a-deployment-branch-policy
106111//
107112//meta:operation PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}
108- func (s * RepositoriesService ) UpdateDeploymentBranchPolicy (ctx context.Context , owner , repo , environment string , branchPolicyID int64 , body * DeploymentBranchPolicyRequest ) (* DeploymentBranchPolicy , * Response , error ) {
113+ func (s * RepositoriesService ) UpdateDeploymentBranchPolicy (ctx context.Context , owner , repo , environment string , branchPolicyID int64 , body UpdateDeploymentBranchPolicyRequest ) (* DeploymentBranchPolicy , * Response , error ) {
109114 u := fmt .Sprintf ("repos/%v/%v/environments/%v/deployment-branch-policies/%v" , owner , repo , environment , branchPolicyID )
110115
111116 req , err := s .client .NewRequest (ctx , "PUT" , u , body )
0 commit comments