Skip to content

Commit

Permalink
feat: spec gen api interface (#1)
Browse files Browse the repository at this point in the history
* feat: specgen api interface

* fix: remove useless dependencies
  • Loading branch information
remisultan authored Oct 16, 2024
1 parent e63d472 commit 16d3561
Show file tree
Hide file tree
Showing 11 changed files with 241 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: 2.1

# this allows you to use CircleCI's dynamic configuration feature
setup: true

orbs:
gravitee: gravitee-io/[email protected]

# our single workflow, that triggers the setup job defined above, filters on tag and branches are needed otherwise
# some workflow and job will not be triggered for tags (default CircleCI behavior)
workflows:
setup_build:
when:
not: << pipeline.git.tag >>
jobs:
- gravitee/setup_lib-build-config:
filters:
tags:
ignore:
- /.*/

setup_release:
when:
matches:
pattern: "/^[0-9]+\\.[0-9]+\\.[0-9]+(-(alpha|beta|rc)\\.[0-9]+)?$/"
value: << pipeline.git.tag >>
jobs:
- gravitee/setup_lib-release-config:
filters:
branches:
ignore:
- /.*/
tags:
only:
- /^[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta|rc)\.[0-9]+)?$/
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @gravitee-io/data
7 changes: 7 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["config:base"],
"prConcurrentLimit": 3,
"dependencyDashboard": true,
"commitMessageTopic": "{{depName}}",
"packageRules": []
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
.idea/
.mvn
target
52 changes: 52 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright © 2015 The Gravitee team (http://gravitee.io)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.gravitee</groupId>
<artifactId>gravitee-parent</artifactId>
<version>22.1.12</version>
</parent>

<groupId>io.gravitee.spec.gen.api</groupId>
<artifactId>gravitee-spec-gen-api</artifactId>
<version>0.1.0</version>

<name>Gravitee SpecGen API</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release>
<gravitee-bom.version>8.1.16</gravitee-bom.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.gravitee</groupId>
<artifactId>gravitee-bom</artifactId>
<version>${gravitee-bom.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
</project>
24 changes: 24 additions & 0 deletions src/main/java/io/gravitee/spec/gen/api/EndpointType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright © 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.spec.gen.api;

/**
* @author Rémi SULTAN (remi.sultan at graviteesource.com)
* @author GraviteeSource Team
*/
public enum EndpointType {
OPEN_API,
}
25 changes: 25 additions & 0 deletions src/main/java/io/gravitee/spec/gen/api/Operation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright © 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.spec.gen.api;

/**
* @author Rémi SULTAN (remi.sultan at graviteesource.com)
* @author GraviteeSource Team
*/
public enum Operation {
GET_STATE,
POST_JOB,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright © 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.spec.gen.api;

public record SchedulingConfiguration(SchedulingUnit unit, Integer value) {}
22 changes: 22 additions & 0 deletions src/main/java/io/gravitee/spec/gen/api/SchedulingUnit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright © 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.spec.gen.api;

public enum SchedulingUnit {
SECONDS,
DAYS,
COUNT,
}
26 changes: 26 additions & 0 deletions src/main/java/io/gravitee/spec/gen/api/SpecGenRequest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright © 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.spec.gen.api;

/**
* @author Rémi SULTAN (remi.sultan at graviteesource.com)
* @author GraviteeSource Team
*/
public record SpecGenRequest(
String apiId,
EndpointType endpointType,
Operation operation
) {}
27 changes: 27 additions & 0 deletions src/main/java/io/gravitee/spec/gen/api/SpecGenRequestState.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright © 2015 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gravitee.spec.gen.api;

/**
* @author Rémi SULTAN (remi.sultan at graviteesource.com)
* @author GraviteeSource Team
*/
public enum SpecGenRequestState {
AVAILABLE,
UNAVAILABLE,
STARTED,
GENERATING,
}

0 comments on commit 16d3561

Please sign in to comment.