Skip to content

Commit

Permalink
fix(google): fixed correct enum values (#2124)
Browse files Browse the repository at this point in the history
igpetrov authored Mar 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 60abf95 commit dbd5d54
Showing 12 changed files with 154 additions and 102 deletions.
Original file line number Diff line number Diff line change
@@ -22,11 +22,11 @@ public record Authentication(
label = "Type",
group = "authentication",
type = Dropdown,
defaultValue = "BEARER",
defaultValue = "refresh",
constraints = @PropertyConstraints(notEmpty = true),
choices = {
@DropdownPropertyChoice(label = "Bearer token", value = "BEARER"),
@DropdownPropertyChoice(label = "Refresh token", value = "REFRESH")
@DropdownPropertyChoice(label = "Bearer token", value = "bearer"),
@DropdownPropertyChoice(label = "Refresh token", value = "refresh")
})
AuthenticationType authType,
@TemplateProperty(
@@ -36,7 +36,7 @@ public record Authentication(
group = "authentication",
feel = FeelMode.optional,
constraints = @PropertyConstraints(notEmpty = true),
condition = @PropertyCondition(property = "authentication.authType", equals = "BEARER"))
condition = @PropertyCondition(property = "authentication.authType", equals = "bearer"))
String bearerToken,
@TemplateProperty(
id = "oauthClientId",
@@ -46,7 +46,7 @@ public record Authentication(
feel = FeelMode.optional,
constraints = @PropertyConstraints(notEmpty = true),
condition =
@PropertyCondition(property = "authentication.authType", equals = "REFRESH"))
@PropertyCondition(property = "authentication.authType", equals = "refresh"))
String oauthClientId,
@TemplateProperty(
id = "oauthClientSecret",
@@ -56,7 +56,7 @@ public record Authentication(
feel = FeelMode.optional,
constraints = @PropertyConstraints(notEmpty = true),
condition =
@PropertyCondition(property = "authentication.authType", equals = "REFRESH"))
@PropertyCondition(property = "authentication.authType", equals = "refresh"))
String oauthClientSecret,
@TemplateProperty(
id = "oauthRefreshToken",
@@ -66,7 +66,7 @@ public record Authentication(
feel = FeelMode.optional,
constraints = @PropertyConstraints(notEmpty = true),
condition =
@PropertyCondition(property = "authentication.authType", equals = "REFRESH"))
@PropertyCondition(property = "authentication.authType", equals = "refresh"))
String oauthRefreshToken) {

@AssertTrue(message = "Credentials were incorrect")
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@
"id" : "authentication.authType",
"label" : "Type",
"optional" : false,
"value" : "BEARER",
"value" : "refresh",
"constraints" : {
"notEmpty" : true
},
@@ -54,11 +54,11 @@
},
"type" : "Dropdown",
"choices" : [ {
"name" : "Refresh token",
"value" : "REFRESH"
}, {
"name" : "Bearer token",
"value" : "BEARER"
"value" : "bearer"
}, {
"name" : "Refresh token",
"value" : "refresh"
} ]
}, {
"id" : "authentication.bearerToken",
@@ -76,7 +76,7 @@
},
"condition" : {
"property" : "authentication.authType",
"equals" : "BEARER",
"equals" : "bearer",
"type" : "simple"
},
"type" : "String"
@@ -96,7 +96,7 @@
},
"condition" : {
"property" : "authentication.authType",
"equals" : "REFRESH",
"equals" : "refresh",
"type" : "simple"
},
"type" : "String"
@@ -116,7 +116,7 @@
},
"condition" : {
"property" : "authentication.authType",
"equals" : "REFRESH",
"equals" : "refresh",
"type" : "simple"
},
"type" : "String"
@@ -136,15 +136,15 @@
},
"condition" : {
"property" : "authentication.authType",
"equals" : "REFRESH",
"equals" : "refresh",
"type" : "simple"
},
"type" : "String"
}, {
"id" : "resource.type",
"label" : "Operation",
"optional" : false,
"value" : "FOLDER",
"value" : "folder",
"constraints" : {
"notEmpty" : true
},
@@ -155,11 +155,11 @@
},
"type" : "Dropdown",
"choices" : [ {
"name" : "Create file from template",
"value" : "FILE"
}, {
"name" : "Create folder",
"value" : "FOLDER"
"value" : "folder"
}, {
"name" : "Create file from template",
"value" : "file"
} ]
}, {
"id" : "resource.name",
@@ -190,7 +190,7 @@
}, {
"id" : "resource.additionalGoogleDriveProperties",
"label" : "Additional properties or metadata",
"optional" : false,
"optional" : true,
"feel" : "required",
"group" : "operationDetails",
"binding" : {
@@ -199,7 +199,7 @@
},
"condition" : {
"property" : "resource.type",
"equals" : "FOLDER",
"equals" : "folder",
"type" : "simple"
},
"type" : "String"
@@ -218,7 +218,7 @@
},
"condition" : {
"property" : "resource.type",
"equals" : "FILE",
"equals" : "file",
"type" : "simple"
},
"type" : "String"
@@ -234,7 +234,7 @@
},
"condition" : {
"property" : "resource.type",
"equals" : "FILE",
"equals" : "file",
"type" : "simple"
},
"type" : "String"
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@
"id" : "authentication.authType",
"label" : "Type",
"optional" : false,
"value" : "BEARER",
"value" : "refresh",
"constraints" : {
"notEmpty" : true
},
@@ -59,11 +59,11 @@
},
"type" : "Dropdown",
"choices" : [ {
"name" : "Refresh token",
"value" : "REFRESH"
}, {
"name" : "Bearer token",
"value" : "BEARER"
"value" : "bearer"
}, {
"name" : "Refresh token",
"value" : "refresh"
} ]
}, {
"id" : "authentication.bearerToken",
@@ -81,7 +81,7 @@
},
"condition" : {
"property" : "authentication.authType",
"equals" : "BEARER",
"equals" : "bearer",
"type" : "simple"
},
"type" : "String"
@@ -101,7 +101,7 @@
},
"condition" : {
"property" : "authentication.authType",
"equals" : "REFRESH",
"equals" : "refresh",
"type" : "simple"
},
"type" : "String"
@@ -121,7 +121,7 @@
},
"condition" : {
"property" : "authentication.authType",
"equals" : "REFRESH",
"equals" : "refresh",
"type" : "simple"
},
"type" : "String"
@@ -141,15 +141,15 @@
},
"condition" : {
"property" : "authentication.authType",
"equals" : "REFRESH",
"equals" : "refresh",
"type" : "simple"
},
"type" : "String"
}, {
"id" : "resource.type",
"label" : "Operation",
"optional" : false,
"value" : "FOLDER",
"value" : "folder",
"constraints" : {
"notEmpty" : true
},
@@ -160,11 +160,11 @@
},
"type" : "Dropdown",
"choices" : [ {
"name" : "Create file from template",
"value" : "FILE"
}, {
"name" : "Create folder",
"value" : "FOLDER"
"value" : "folder"
}, {
"name" : "Create file from template",
"value" : "file"
} ]
}, {
"id" : "resource.name",
@@ -195,7 +195,7 @@
}, {
"id" : "resource.additionalGoogleDriveProperties",
"label" : "Additional properties or metadata",
"optional" : false,
"optional" : true,
"feel" : "required",
"group" : "operationDetails",
"binding" : {
@@ -204,7 +204,7 @@
},
"condition" : {
"property" : "resource.type",
"equals" : "FOLDER",
"equals" : "folder",
"type" : "simple"
},
"type" : "String"
@@ -223,7 +223,7 @@
},
"condition" : {
"property" : "resource.type",
"equals" : "FILE",
"equals" : "file",
"type" : "simple"
},
"type" : "String"
@@ -239,7 +239,7 @@
},
"condition" : {
"property" : "resource.type",
"equals" : "FILE",
"equals" : "file",
"type" : "simple"
},
"type" : "String"
17 changes: 12 additions & 5 deletions connectors/google/google-drive/pom.xml
Original file line number Diff line number Diff line change
@@ -49,11 +49,18 @@
<artifactId>element-template-generator-maven-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<connectorClasses>
<connectorClass>io.camunda.connector.gdrive.GoogleDriveFunction</connectorClass>
</connectorClasses>
<generateHybridTemplates>true</generateHybridTemplates>
<templateFileName>google-drive-outbound-connector</templateFileName>
<connectors>
<connector>
<connectorClass>io.camunda.connector.gdrive.GoogleDriveFunction</connectorClass>
<files>
<file>
<templateId>io.camunda.connectors.GoogleDrive.v1</templateId>
<templateFileName>google-drive-outbound-connector.json</templateFileName>
</file>
</files>
<generateHybridTemplates>true</generateHybridTemplates>
</connector>
</connectors>
<includeDependencies>io.camunda.connector:connector-google-base</includeDependencies>
</configuration>
</plugin>
Original file line number Diff line number Diff line change
@@ -24,11 +24,11 @@ public record Resource(
label = "Operation",
group = "operation",
type = Dropdown,
defaultValue = "FOLDER",
defaultValue = "folder",
constraints = @PropertyConstraints(notEmpty = true),
choices = {
@DropdownPropertyChoice(label = "Create folder", value = "FOLDER"),
@DropdownPropertyChoice(label = "Create file from template", value = "FILE")
@DropdownPropertyChoice(label = "Create folder", value = "folder"),
@DropdownPropertyChoice(label = "Create file from template", value = "file")
})
@NotNull
Type type,
@@ -54,6 +54,7 @@ public record Resource(
label = "Additional properties or metadata",
group = "operationDetails",
feel = FeelMode.required,
condition = @PropertyCondition(property = "resource.type", equals = "FOLDER"))
optional = true,
condition = @PropertyCondition(property = "resource.type", equals = "folder"))
JsonNode additionalGoogleDriveProperties,
@Valid Template template) {}
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ public record Template(
label = "Template ID",
group = "operationDetails",
feel = FeelMode.optional,
condition = @PropertyCondition(property = "resource.type", equals = "FILE"))
condition = @PropertyCondition(property = "resource.type", equals = "file"))
@NotEmpty
String id,
@NestedProperties(addNestedPath = false) Variables variables) {}
Original file line number Diff line number Diff line change
@@ -19,5 +19,5 @@ public record Variables(
group = "operationDetails",
feel = FeelMode.required,
binding = @PropertyBinding(name = "variables"),
condition = @PropertyCondition(property = "resource.type", equals = "FILE"))
condition = @PropertyCondition(property = "resource.type", equals = "file"))
JsonNode requests) {}
Loading

0 comments on commit dbd5d54

Please sign in to comment.