Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method to update endpoint permissions for all pipelines #83

Closed
wants to merge 1 commit into from

Conversation

beandrad
Copy link

@beandrad beandrad commented Aug 4, 2020

So that all pipelines can be granted or denied access to
service endpoints.

Issue: #82

Example of use:

        // Create a client to interact with the Pipelines area
	pipelineClient := pipelines.NewClient(ctx, connection)
	if err != nil {
		log.Fatal(err)
	}
	resource_id := "9948edhu-b56d-4890-b0a6-0a980b1d8904"
	project := "testProject"
	authorized := true
	args := pipelines.UpdateEndpointPermissionsArgs{
		PermissionsParameters: &pipelines.PipelineResourcePermissions{
			Resource:     &pipelines.Resource{Id: &resource_id, Type: nil},
			AllPipelines: &pipelines.ResourcePermissions{Authorized: &authorized},
			Pipelines:    nil,
		},
		Project: &project,
	}
	permissionResponse, err := pipelineClient.UpdateEndpointPermissions(ctx, args)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("%v", *permissionResponse.AllPipelines.Authorized)

So that all pipelines can be granted or denied access to
service endpoints.
@tedchamb
Copy link
Member

tedchamb commented Aug 7, 2020

These are autogenerated files. They should not be hand edited. In order to add methods new clients will need to be generated.

@beandrad
Copy link
Author

beandrad commented Aug 7, 2020

Thanks for looking into it @tedchamb. I'm not sure how to autogenerate the pipelines client; I was thinking of using Autorest and https://github.com/MicrosoftDocs/vsts-rest-api-specs/tree/master/specification, but I cannot find the corresponding configuration file in the repo.

@tedchamb
Copy link
Member

@goflores, the clients are generated with the internal tool genclient. Ping me and I can help you as this means we will need to create a new major version.

@tedchamb
Copy link
Member

Added in #87

@tedchamb tedchamb closed this Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants