@@ -93,18 +93,19 @@ public Optional<Environment> getOptionalEnvironment(Object projectIdOrPath, Long
93
93
}
94
94
95
95
/**
96
- * Create a new environment with the given name and external_url .
96
+ * Create a new environment with the given name, external_url and tier .
97
97
*
98
98
* <pre><code>GitLab Endpoint:POST /projects/:id/environments</code></pre>
99
99
*
100
100
* @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
101
101
* @param name the name of the environment
102
102
* @param externalUrl the place to link to for this environment
103
+ * @param tier the tier of the environment
103
104
* @return the created Environment instance
104
105
* @throws GitLabApiException if any exception occurs
105
106
*/
106
- public Environment createEnvironment (Object projectIdOrPath , String name , String externalUrl ) throws GitLabApiException {
107
- GitLabApiForm formData = new GitLabApiForm ().withParam ("name" , name , true ).withParam ("external_url" , externalUrl );
107
+ public Environment createEnvironment (Object projectIdOrPath , String name , String externalUrl , String tier ) throws GitLabApiException {
108
+ GitLabApiForm formData = new GitLabApiForm ().withParam ("name" , name , true ).withParam ("external_url" , externalUrl ). withParam ( "tier" , tier ) ;
108
109
Response response = post (Response .Status .CREATED , formData ,
109
110
"projects" , getProjectIdOrPath (projectIdOrPath ), "environments" );
110
111
return (response .readEntity (Environment .class ));
@@ -119,11 +120,12 @@ public Environment createEnvironment(Object projectIdOrPath, String name, String
119
120
* @param environmentId the ID of the environment to update
120
121
* @param name the name of the environment
121
122
* @param externalUrl the place to link to for this environment
123
+ * @param tier the tier of the environment
122
124
* @return the created Environment instance
123
125
* @throws GitLabApiException if any exception occurs
124
126
*/
125
- public Environment updateEnvironment (Object projectIdOrPath , Long environmentId , String name , String externalUrl ) throws GitLabApiException {
126
- GitLabApiForm formData = new GitLabApiForm ().withParam ("name" , name ).withParam ("external_url" , externalUrl );
127
+ public Environment updateEnvironment (Object projectIdOrPath , Long environmentId , String name , String externalUrl , String tier ) throws GitLabApiException {
128
+ GitLabApiForm formData = new GitLabApiForm ().withParam ("name" , name ).withParam ("external_url" , externalUrl ). withParam ( "tier" , tier ) ;
127
129
Response response = putWithFormData (Response .Status .OK , formData , formData ,
128
130
"projects" , getProjectIdOrPath (projectIdOrPath ), "environments" , environmentId );
129
131
return (response .readEntity (Environment .class ));
@@ -175,4 +177,4 @@ public Environment createEnvironment(Object projectIdOrPath, Long environmentId)
175
177
"projects" , getProjectIdOrPath (projectIdOrPath ), "environments" , environmentId , "stop" );
176
178
return (response .readEntity (Environment .class ));
177
179
}
178
- }
180
+ }
0 commit comments