Skip to content

Commit

Permalink
Merge pull request #10 from StyraInc/speakeasy-sdk-regen-1711498115
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate
  • Loading branch information
charlesdaniels authored Mar 28, 2024
2 parents 8c4def3 + 19f6ade commit be24804
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 23 deletions.
10 changes: 5 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ id: 47e8e950-a454-4ebb-9f78-86fda7dfa0c2
management:
docChecksum: 2401c7030f847f72ab31c8f75de58a66
docVersion: 0.2.0
speakeasyVersion: 1.215.1
generationVersion: 2.286.4
releaseVersion: 0.4.0
configChecksum: 1a18abf1630c80ad24e0c9ac9f675537
speakeasyVersion: 1.228.1
generationVersion: 2.292.0
releaseVersion: 0.4.2
configChecksum: 08d35dbc71ccfdebb00b73ce95c95b6e
repoURL: https://github.com/StyraInc/opa-java.git
features:
java:
constsAndDefaults: 0.1.1
core: 3.16.0
core: 3.16.2
examples: 2.81.3
flattening: 2.81.1
globalServerURLs: 2.82.1
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
java:
version: 0.4.0
version: 0.4.2
additionalDependencies: []
artifactID: opa
companyEmail: devrel@styra.com
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ Once published to a repository (local or otherwise), the SDK artifact is used as

Gradle:
```groovy
implementation 'com.styra.opa:api:0.4.0'
implementation 'com.styra.opa:api:0.4.2'
```

Maven:
```xml
<dependency>
<groupId>com.styra.opa</groupId>
<artifactId>api</artifactId>
<version>0.4.0</version>
<version>0.4.2</version>
</dependency>
```

Expand All @@ -48,6 +48,7 @@ gradlew.bat publishToMavenLocal -Pskip.signing
```java
package hello.world;

import com.styra.opa.Opa;
import com.styra.opa.models.operations.*;
import com.styra.opa.models.operations.ExecutePolicyWithInputRequest;
import com.styra.opa.models.operations.ExecutePolicyWithInputRequestBody;
Expand All @@ -56,7 +57,6 @@ import com.styra.opa.models.shared.*;
import com.styra.opa.models.shared.Explain;
import com.styra.opa.models.shared.GzipAcceptEncoding;
import com.styra.opa.models.shared.GzipContentEncoding;
import com.styra.opa.opa;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
Expand Down Expand Up @@ -133,13 +133,13 @@ You can override the default server globally by passing a server index to the `s
```java
package hello.world;

import com.styra.opa.Opa;
import com.styra.opa.models.operations.*;
import com.styra.opa.models.operations.ExecutePolicyRequest;
import com.styra.opa.models.operations.ExecutePolicyResponse;
import com.styra.opa.models.shared.*;
import com.styra.opa.models.shared.Explain;
import com.styra.opa.models.shared.GzipAcceptEncoding;
import com.styra.opa.opa;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
Expand Down Expand Up @@ -189,13 +189,13 @@ The default server can also be overridden globally by passing a URL to the `serv
```java
package hello.world;

import com.styra.opa.Opa;
import com.styra.opa.models.operations.*;
import com.styra.opa.models.operations.ExecutePolicyRequest;
import com.styra.opa.models.operations.ExecutePolicyResponse;
import com.styra.opa.models.shared.*;
import com.styra.opa.models.shared.Explain;
import com.styra.opa.models.shared.GzipAcceptEncoding;
import com.styra.opa.opa;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
Expand Down Expand Up @@ -253,13 +253,13 @@ Handling errors in this SDK should largely match your expectations. All operati
```java
package hello.world;

import com.styra.opa.Opa;
import com.styra.opa.models.operations.*;
import com.styra.opa.models.operations.ExecutePolicyRequest;
import com.styra.opa.models.operations.ExecutePolicyResponse;
import com.styra.opa.models.shared.*;
import com.styra.opa.models.shared.Explain;
import com.styra.opa.models.shared.GzipAcceptEncoding;
import com.styra.opa.opa;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
Expand Down
18 changes: 17 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,20 @@ Based on:
- OpenAPI Doc
- Speakeasy CLI 1.215.1 (2.286.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.4.0] .
- [java v0.4.0] .

## 2024-03-27 00:08:32
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.227.0 (2.291.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.4.1] .

## 2024-03-28 00:09:06
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.228.1 (2.292.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [java v0.4.2] .
2 changes: 1 addition & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
```java
package hello.world;

import com.styra.opa.Opa;
import com.styra.opa.models.operations.*;
import com.styra.opa.models.operations.ExecutePolicyWithInputRequest;
import com.styra.opa.models.operations.ExecutePolicyWithInputRequestBody;
Expand All @@ -10,7 +11,6 @@ import com.styra.opa.models.shared.*;
import com.styra.opa.models.shared.Explain;
import com.styra.opa.models.shared.GzipAcceptEncoding;
import com.styra.opa.models.shared.GzipContentEncoding;
import com.styra.opa.opa;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
Expand Down
6 changes: 3 additions & 3 deletions docs/sdks/opa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Execute a policy
```java
package hello.world;

import com.styra.opa.Opa;
import com.styra.opa.models.operations.*;
import com.styra.opa.models.operations.ExecutePolicyRequest;
import com.styra.opa.models.operations.ExecutePolicyResponse;
import com.styra.opa.models.shared.*;
import com.styra.opa.models.shared.Explain;
import com.styra.opa.models.shared.GzipAcceptEncoding;
import com.styra.opa.opa;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
Expand Down Expand Up @@ -93,6 +93,7 @@ Execute a policy given an input
```java
package hello.world;

import com.styra.opa.Opa;
import com.styra.opa.models.operations.*;
import com.styra.opa.models.operations.ExecutePolicyWithInputRequest;
import com.styra.opa.models.operations.ExecutePolicyWithInputRequestBody;
Expand All @@ -101,7 +102,6 @@ import com.styra.opa.models.shared.*;
import com.styra.opa.models.shared.Explain;
import com.styra.opa.models.shared.GzipAcceptEncoding;
import com.styra.opa.models.shared.GzipContentEncoding;
import com.styra.opa.opa;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
Expand Down Expand Up @@ -176,11 +176,11 @@ The health API endpoint executes a simple built-in policy query to verify that t
```java
package hello.world;

import com.styra.opa.Opa;
import com.styra.opa.models.operations.*;
import com.styra.opa.models.operations.HealthRequest;
import com.styra.opa.models.operations.HealthResponse;
import com.styra.opa.models.shared.*;
import com.styra.opa.opa;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/styra/opa/Opa.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public com.styra.opa.models.operations.ExecutePolicyResponse executePolicy(
}
}

java.util.Map<String, java.util.List<String>> headers = com.styra.opa.utils.Utils.getHeaders(request);
java.util.Map<String, java.util.List<String>> headers = com.styra.opa.utils.Utils.getHeaders(request, null);
if (headers != null) {
for (java.util.Map.Entry<String, java.util.List<String>> header : headers.entrySet()) {
for (String value : header.getValue()) {
Expand Down Expand Up @@ -292,7 +292,7 @@ public com.styra.opa.models.operations.ExecutePolicyWithInputResponse executePol
}
}

java.util.Map<String, java.util.List<String>> headers = com.styra.opa.utils.Utils.getHeaders(request);
java.util.Map<String, java.util.List<String>> headers = com.styra.opa.utils.Utils.getHeaders(request, null);
if (headers != null) {
for (java.util.Map.Entry<String, java.util.List<String>> header : headers.entrySet()) {
for (String value : header.getValue()) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/styra/opa/SDKConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class SDKConfiguration {
public int serverIdx = 0;
public String language = "java";
public String openapiDocVersion = "0.2.0";
public String sdkVersion = "0.4.0";
public String genVersion = "2.286.4";
public String userAgent = "speakeasy-sdk/java 0.4.0 2.286.4 0.2.0 com.styra.opa";
public String sdkVersion = "0.4.2";
public String genVersion = "2.292.0";
public String userAgent = "speakeasy-sdk/java 0.4.2 2.292.0 0.2.0 com.styra.opa";


public Optional<RetryConfig> retryConfig = Optional.empty();
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/styra/opa/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public static String templateUrl(String url, Map<String, String> params) {
return sb.toString();
}

public static Map<String, List<String>> getHeaders(Object headers) throws Exception {
public static Map<String, List<String>> getHeaders(Object headers, Map<String, Map<String, Map<String, Object>>> globals) throws Exception {
if (headers == null) {
return null;
}
Expand All @@ -297,6 +297,10 @@ public static Map<String, List<String>> getHeaders(Object headers) throws Except

Object value = field.get(headers);
value = resolveOptionals(value);
value = Utils.populateGlobal(value, field.getName(), "header", globals);
if (value == null) {
continue;
}
if (value == null) {
continue;
}
Expand Down

0 comments on commit be24804

Please sign in to comment.