@@ -2645,7 +2645,7 @@ public Variable createVariable(Object projectIdOrPath, String key, String value,
26452645 * @throws GitLabApiException if any exception occurs during execution
26462646 */
26472647 public Variable createVariable (Object projectIdOrPath , String key , String value , Boolean isProtected , String environmentScope ) throws GitLabApiException {
2648- return createVariable (projectIdOrPath , key , value , isProtected , null , environmentScope );
2648+ return createVariable (projectIdOrPath , key , value , null , isProtected , null , environmentScope );
26492649 }
26502650
26512651 /**
@@ -2658,13 +2658,15 @@ public Variable createVariable(Object projectIdOrPath, String key, String value,
26582658 * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
26592659 * @param key the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, required
26602660 * @param value the value for the variable, required
2661+ * @param variableType the type of variable. Available types are: env_var (default) and file
26612662 * @param isProtected whether the variable is protected, optional
26622663 * @param isMasked whether the variable is masked, optional
26632664 * @return a Variable instance with the newly created variable
26642665 * @throws GitLabApiException if any exception occurs during execution
26652666 */
2666- public Variable createVariable (Object projectIdOrPath , String key , String value , Boolean isProtected , Boolean isMasked ) throws GitLabApiException {
2667- return createVariable (projectIdOrPath , key , value , isProtected , isMasked , null );
2667+ public Variable createVariable (Object projectIdOrPath , String key , String value , Variable .Type variableType ,
2668+ Boolean isProtected , Boolean isMasked ) throws GitLabApiException {
2669+ return createVariable (projectIdOrPath , key , value , variableType , isProtected , isMasked , null );
26682670 }
26692671
26702672 /**
@@ -2677,17 +2679,20 @@ public Variable createVariable(Object projectIdOrPath, String key, String value,
26772679 * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
26782680 * @param key the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, required
26792681 * @param value the value for the variable, required
2682+ * @param variableType the type of variable. Available types are: env_var (default) and file
26802683 * @param isProtected whether the variable is protected, optional
26812684 * @param isMasked whether the variable is masked, optional
26822685 * @param environmentScope the environment_scope of the variable, optional
26832686 * @return a Variable instance with the newly created variable
26842687 * @throws GitLabApiException if any exception occurs during execution
26852688 */
2686- public Variable createVariable (Object projectIdOrPath , String key , String value , Boolean isProtected , Boolean isMasked , String environmentScope ) throws GitLabApiException {
2689+ public Variable createVariable (Object projectIdOrPath , String key , String value , Variable .Type variableType ,
2690+ Boolean isProtected , Boolean isMasked , String environmentScope ) throws GitLabApiException {
26872691
26882692 GitLabApiForm formData = new GitLabApiForm ()
26892693 .withParam ("key" , key , true )
26902694 .withParam ("value" , value , true )
2695+ .withParam ("variable_type" , variableType )
26912696 .withParam ("protected" , isProtected )
26922697 .withParam ("masked" , isMasked )
26932698 .withParam ("environment_scope" , environmentScope );
@@ -2708,7 +2713,7 @@ public Variable createVariable(Object projectIdOrPath, String key, String value,
27082713 * @throws GitLabApiException if any exception occurs during execution
27092714 */
27102715 public Variable updateVariable (Object projectIdOrPath , String key , String value , Boolean isProtected ) throws GitLabApiException {
2711- return (updateVariable (projectIdOrPath , key , value , isProtected , ( String ) null ));
2716+ return (updateVariable (projectIdOrPath , key , value , null , isProtected , null , null ));
27122717 }
27132718
27142719 /**
@@ -2727,7 +2732,7 @@ public Variable updateVariable(Object projectIdOrPath, String key, String value,
27272732 * @throws GitLabApiException if any exception occurs during execution
27282733 */
27292734 public Variable updateVariable (Object projectIdOrPath , String key , String value , Boolean isProtected , String environmentScope ) throws GitLabApiException {
2730- return updateVariable (projectIdOrPath , key , value , isProtected , null , environmentScope );
2735+ return updateVariable (projectIdOrPath , key , value , null , isProtected , null , environmentScope );
27312736 }
27322737
27332738 /**
@@ -2740,13 +2745,15 @@ public Variable updateVariable(Object projectIdOrPath, String key, String value,
27402745 * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
27412746 * @param key the key of an existing variable, required
27422747 * @param value the value for the variable, required
2748+ * @param variableType the type of variable. Available types are: env_var (default) and file
27432749 * @param isProtected whether the variable is protected, optional
2744- * @param isMasked whether the variable is masked, optional
2750+ * @param masked whether the variable is masked, optional
27452751 * @return a Variable instance with the updated variable
27462752 * @throws GitLabApiException if any exception occurs during execution
27472753 */
2748- public Variable updateVariable (Object projectIdOrPath , String key , String value , Boolean isProtected , Boolean isMasked ) throws GitLabApiException {
2749- return updateVariable (projectIdOrPath , key , value , isProtected , isMasked , null );
2754+ public Variable updateVariable (Object projectIdOrPath , String key , String value , Variable .Type variableType ,
2755+ Boolean isProtected , Boolean masked ) throws GitLabApiException {
2756+ return updateVariable (projectIdOrPath , key , value , variableType , isProtected , masked , null );
27502757 }
27512758
27522759 /**
@@ -2759,19 +2766,22 @@ public Variable updateVariable(Object projectIdOrPath, String key, String value,
27592766 * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
27602767 * @param key the key of an existing variable, required
27612768 * @param value the value for the variable, required
2769+ * @param variableType the type of variable. Available types are: env_var (default) and file
27622770 * @param isProtected whether the variable is protected, optional
2763- * @param isMasked whether the variable is masked, optional
2771+ * @param masked whether the variable is masked, optional
27642772 * @param environmentScope the environment_scope of the variable, optional.
27652773 * @return a Variable instance with the updated variable
27662774 * @throws GitLabApiException if any exception occurs during execution
27672775 */
2768- public Variable updateVariable (Object projectIdOrPath , String key , String value , Boolean isProtected , Boolean isMasked , String environmentScope ) throws GitLabApiException {
2776+ public Variable updateVariable (Object projectIdOrPath , String key , String value , Variable .Type variableType ,
2777+ Boolean isProtected , Boolean masked , String environmentScope ) throws GitLabApiException {
27692778
27702779 GitLabApiForm formData = new GitLabApiForm ()
27712780 .withParam ("value" , value , true )
2781+ .withParam ("variable_type" , variableType )
27722782 .withParam ("protected" , isProtected )
2773- .withParam ("masked" , isMasked )
2774- .withParam ("environment_scope" , environmentScope );
2783+ .withParam ("masked" , masked )
2784+ .withParam ("environment_scope" , environmentScope );
27752785 Response response = putWithFormData (Response .Status .OK , formData , "projects" , getProjectIdOrPath (projectIdOrPath ), "variables" , key );
27762786 return (response .readEntity (Variable .class ));
27772787 }
0 commit comments