@@ -8,11 +8,11 @@ import (
88 "github.com/CircleCI-Public/circleci-cli/settings"
99)
1010
11- type projectRestClient struct {
11+ type ProjectRestClient struct {
1212 client * rest.Client
1313}
1414
15- var _ ProjectClient = & projectRestClient {}
15+ var _ ProjectClient = & ProjectRestClient {}
1616
1717type listProjectEnvVarsParams struct {
1818 vcs string
@@ -60,10 +60,10 @@ type projectInfo struct {
6060 Id string `json:"id"`
6161}
6262
63- // NewProjectRestClient returns a new projectRestClient satisfying the api.ProjectInterface
63+ // NewProjectRestClient returns a new ProjectRestClient satisfying the api.ProjectInterface
6464// interface via the REST API.
65- func NewProjectRestClient (config settings.Config ) (* projectRestClient , error ) {
66- client := & projectRestClient {
65+ func NewProjectRestClient (config settings.Config ) (* ProjectRestClient , error ) {
66+ client := & ProjectRestClient {
6767 client : rest .NewFromConfig (config .Host , & config ),
6868 }
6969 return client , nil
@@ -72,7 +72,7 @@ func NewProjectRestClient(config settings.Config) (*projectRestClient, error) {
7272// ListAllEnvironmentVariables returns all of the environment variables owned by the
7373// given project. Note that pagination is not supported - we get all
7474// pages of env vars and return them all.
75- func (p * projectRestClient ) ListAllEnvironmentVariables (vcs , org , project string ) ([]* ProjectEnvironmentVariable , error ) {
75+ func (p * ProjectRestClient ) ListAllEnvironmentVariables (vcs , org , project string ) ([]* ProjectEnvironmentVariable , error ) {
7676 res := make ([]* ProjectEnvironmentVariable , 0 )
7777 var nextPageToken string
7878 for {
@@ -102,7 +102,7 @@ func (p *projectRestClient) ListAllEnvironmentVariables(vcs, org, project string
102102 return res , nil
103103}
104104
105- func (c * projectRestClient ) listEnvironmentVariables (params * listProjectEnvVarsParams ) (* listAllProjectEnvVarsResponse , error ) {
105+ func (c * ProjectRestClient ) listEnvironmentVariables (params * listProjectEnvVarsParams ) (* listAllProjectEnvVarsResponse , error ) {
106106 path := fmt .Sprintf ("project/%s/%s/%s/envvar" , params .vcs , params .org , params .project )
107107 urlParams := url.Values {}
108108 if params .pageToken != "" {
@@ -124,7 +124,7 @@ func (c *projectRestClient) listEnvironmentVariables(params *listProjectEnvVarsP
124124
125125// GetEnvironmentVariable retrieves and returns a variable with the given name.
126126// If the response status code is 404, nil is returned.
127- func (c * projectRestClient ) GetEnvironmentVariable (vcs string , org string , project string , envName string ) (* ProjectEnvironmentVariable , error ) {
127+ func (c * ProjectRestClient ) GetEnvironmentVariable (vcs string , org string , project string , envName string ) (* ProjectEnvironmentVariable , error ) {
128128 path := fmt .Sprintf ("project/%s/%s/%s/envvar/%s" , vcs , org , project , envName )
129129 req , err := c .client .NewRequest ("GET" , & url.URL {Path : path }, nil )
130130 if err != nil {
@@ -147,7 +147,7 @@ func (c *projectRestClient) GetEnvironmentVariable(vcs string, org string, proje
147147 }, nil
148148}
149149
150- func (c * projectRestClient ) CreateProject (vcs string , org string , name string ) (* CreateProjectInfo , error ) {
150+ func (c * ProjectRestClient ) CreateProject (vcs string , org string , name string ) (* CreateProjectInfo , error ) {
151151 orgSlug := fmt .Sprintf ("%s/%s" , vcs , org )
152152
153153 path := fmt .Sprintf ("organization/%s/project" , orgSlug )
@@ -178,7 +178,7 @@ func (c *projectRestClient) CreateProject(vcs string, org string, name string) (
178178
179179// CreateEnvironmentVariable creates a variable on the given project.
180180// This returns the variable if successfully created.
181- func (c * projectRestClient ) CreateEnvironmentVariable (vcs string , org string , project string , v ProjectEnvironmentVariable ) (* ProjectEnvironmentVariable , error ) {
181+ func (c * ProjectRestClient ) CreateEnvironmentVariable (vcs string , org string , project string , v ProjectEnvironmentVariable ) (* ProjectEnvironmentVariable , error ) {
182182 path := fmt .Sprintf ("project/%s/%s/%s/envvar" , vcs , org , project )
183183 req , err := c .client .NewRequest ("POST" , & url.URL {Path : path }, & createProjectEnvVarRequest {
184184 Name : v .Name ,
@@ -200,7 +200,7 @@ func (c *projectRestClient) CreateEnvironmentVariable(vcs string, org string, pr
200200}
201201
202202// ProjectInfo retrieves and returns the project info.
203- func (c * projectRestClient ) ProjectInfo (vcs string , org string , project string ) (* ProjectInfo , error ) {
203+ func (c * ProjectRestClient ) ProjectInfo (vcs string , org string , project string ) (* ProjectInfo , error ) {
204204 path := fmt .Sprintf ("project/%s/%s/%s" , vcs , org , project )
205205 req , err := c .client .NewRequest ("GET" , & url.URL {Path : path }, nil )
206206 if err != nil {
0 commit comments