Skip to content

Commit

Permalink
Closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
yildizsc committed Dec 14, 2023
1 parent 999f3f1 commit 53aeab6
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 104 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Build with Maven
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<artifactId>webex-events</artifactId>
<version>0.1.0</version>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>

<build>
Expand All @@ -23,8 +23,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
<source>8</source>
<target>8</target>
</configuration>
</plugin>

Expand Down
118 changes: 20 additions & 98 deletions src/main/java/com/webex/events/Helpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import com.webex.events.exceptions.AccessTokenIsRequiredError;
import com.webex.events.exceptions.InvalidUUIDFormatError;

import java.io.IOException;
import java.io.*;
import java.net.InetAddress;
import java.net.URI;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Objects;
import java.util.Properties;
import java.util.regex.Pattern;

Expand All @@ -25,7 +26,7 @@ static String getSDKVersion() {
try {
if (sdkVersion == null) {
Properties properties = new Properties();
properties.load(Client.class.getResourceAsStream("/version.properties"));
properties.load(Helpers.class.getResourceAsStream("/version.properties"));
return sdkVersion = properties.getProperty("version");
}
} catch (IOException ignored) {
Expand Down Expand Up @@ -95,101 +96,22 @@ public static String getIntrospectionQuery() {
if (introspectionQuery != null) {
return introspectionQuery;
}
return introspectionQuery = """
query IntrospectionQuery {
__schema {
\s
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
name
description
locations
\s
args {
...InputValue
}
}
}
}
fragment FullType on __Type {
kind
name
description
\s
\s
fields(includeDeprecated: true) {
name
description
args {
...InputValue
}
type {
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields {
...InputValue
}
interfaces {
...TypeRef
}
enumValues(includeDeprecated: true) {
name
description
isDeprecated
deprecationReason
}
possibleTypes {
...TypeRef
}
}
fragment InputValue on __InputValue {
name
description
type { ...TypeRef }
defaultValue
\s
\s
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
}
}
}
""";

try {
ClassLoader classLoader = Helpers.class.getClassLoader();
File file = new File(Objects.requireNonNull(classLoader.getResource("introspection.query")).getFile());
InputStream inputStream = new FileInputStream(file);

BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder sb = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
sb.append(line);
}

introspectionQuery = sb.toString();
} catch (IOException ignored) {
}
return introspectionQuery;
}
}
94 changes: 94 additions & 0 deletions src/main/resources/introspection.query
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
query IntrospectionQuery {
__schema {
s
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
name
description
locations
s
args {
...InputValue
}
}
}
}
fragment FullType on __Type {
kind
name
description
s
s
fields(includeDeprecated: true) {
name
description
args {
...InputValue
}
type {
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields {
...InputValue
}
interfaces {
...TypeRef
}
enumValues(includeDeprecated: true) {
name
description
isDeprecated
deprecationReason
}
possibleTypes {
...TypeRef
}
}
fragment InputValue on __InputValue {
name
description
type { ...TypeRef }
defaultValue
s
s
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
}
}
}

0 comments on commit 53aeab6

Please sign in to comment.