Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"retry-status-codes": "legacy"
},
"originGitCommit": "4ec89179f0cd7c09cc536f40a9c42a089d9cd425",
"originGitCommit": "55f4ed66327cc60c86a1edef9596d71673752c85",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"ciProvider": "github",
Expand Down
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
public final class CreateOauthAppOpts {
private final String app;

private final String clientId;
private final Optional<String> clientId;

private final String clientSecret;
private final Optional<String> clientSecret;

private final Optional<String> name;

Expand All @@ -40,8 +40,8 @@ public final class CreateOauthAppOpts {

private CreateOauthAppOpts(
String app,
String clientId,
String clientSecret,
Optional<String> clientId,
Optional<String> clientSecret,
Optional<String> name,
Optional<String> description,
Optional<List<String>> scopes,
Expand All @@ -66,18 +66,18 @@ public String getApp() {
}

/**
* @return The OAuth client ID registered with the upstream provider
* @return The OAuth client ID registered with the upstream provider. Optional: providers that only issue credentials once they have a callback URL can be registered without one, and the client cannot connect accounts until it is set.
*/
@JsonProperty("client_id")
public String getClientId() {
public Optional<String> getClientId() {
return clientId;
}

/**
* @return The OAuth client secret. Write-only; never returned in responses.
* @return The OAuth client secret. Optional, like the client ID. Write-only; never returned in responses.
*/
@JsonProperty("client_secret")
public String getClientSecret() {
public Optional<String> getClientSecret() {
return clientSecret;
}

Expand Down Expand Up @@ -159,32 +159,32 @@ public interface AppStage {
/**
* <p>The app's ID or name slug. The app must have custom OAuth clients enabled.</p>
*/
ClientIdStage app(@NotNull String app);
_FinalStage app(@NotNull String app);

Builder from(CreateOauthAppOpts other);
}

public interface ClientIdStage {
/**
* <p>The OAuth client ID registered with the upstream provider</p>
*/
ClientSecretStage clientId(@NotNull String clientId);
}

public interface ClientSecretStage {
/**
* <p>The OAuth client secret. Write-only; never returned in responses.</p>
*/
_FinalStage clientSecret(@NotNull String clientSecret);
}

public interface _FinalStage {
CreateOauthAppOpts build();

_FinalStage additionalProperty(String key, Object value);

_FinalStage additionalProperties(Map<String, Object> additionalProperties);

/**
* <p>The OAuth client ID registered with the upstream provider. Optional: providers that only issue credentials once they have a callback URL can be registered without one, and the client cannot connect accounts until it is set.</p>
*/
_FinalStage clientId(Optional<String> clientId);

_FinalStage clientId(String clientId);

/**
* <p>The OAuth client secret. Optional, like the client ID. Write-only; never returned in responses.</p>
*/
_FinalStage clientSecret(Optional<String> clientSecret);

_FinalStage clientSecret(String clientSecret);

/**
* <p>Display name of the OAuth client</p>
*/
Expand Down Expand Up @@ -215,13 +215,9 @@ public interface _FinalStage {
}

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder implements AppStage, ClientIdStage, ClientSecretStage, _FinalStage {
public static final class Builder implements AppStage, _FinalStage {
private String app;

private String clientId;

private String clientSecret;

private Optional<List<String>> additionalScopes = Optional.empty();

private Optional<List<String>> scopes = Optional.empty();
Expand All @@ -230,6 +226,10 @@ public static final class Builder implements AppStage, ClientIdStage, ClientSecr

private Optional<String> name = Optional.empty();

private Optional<String> clientSecret = Optional.empty();

private Optional<String> clientId = Optional.empty();

@JsonAnySetter
private Map<String, Object> additionalProperties = new HashMap<>();

Expand All @@ -254,35 +254,11 @@ public Builder from(CreateOauthAppOpts other) {
*/
@java.lang.Override
@JsonSetter("app")
public ClientIdStage app(@NotNull String app) {
public _FinalStage app(@NotNull String app) {
this.app = Objects.requireNonNull(app, "app must not be null");
return this;
}

/**
* <p>The OAuth client ID registered with the upstream provider</p>
* <p>The OAuth client ID registered with the upstream provider</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("client_id")
public ClientSecretStage clientId(@NotNull String clientId) {
this.clientId = Objects.requireNonNull(clientId, "clientId must not be null");
return this;
}

/**
* <p>The OAuth client secret. Write-only; never returned in responses.</p>
* <p>The OAuth client secret. Write-only; never returned in responses.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("client_secret")
public _FinalStage clientSecret(@NotNull String clientSecret) {
this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret must not be null");
return this;
}

/**
* <p>Extra OAuth scopes users may grant on top of the base scopes</p>
* @return Reference to {@code this} so that method calls can be chained together.
Expand Down Expand Up @@ -363,6 +339,46 @@ public _FinalStage name(Optional<String> name) {
return this;
}

/**
* <p>The OAuth client secret. Optional, like the client ID. Write-only; never returned in responses.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage clientSecret(String clientSecret) {
this.clientSecret = Optional.ofNullable(clientSecret);
return this;
}

/**
* <p>The OAuth client secret. Optional, like the client ID. Write-only; never returned in responses.</p>
*/
@java.lang.Override
@JsonSetter(value = "client_secret", nulls = Nulls.SKIP)
public _FinalStage clientSecret(Optional<String> clientSecret) {
this.clientSecret = clientSecret;
return this;
}

/**
* <p>The OAuth client ID registered with the upstream provider. Optional: providers that only issue credentials once they have a callback URL can be registered without one, and the client cannot connect accounts until it is set.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage clientId(String clientId) {
this.clientId = Optional.ofNullable(clientId);
return this;
}

/**
* <p>The OAuth client ID registered with the upstream provider. Optional: providers that only issue credentials once they have a callback URL can be registered without one, and the client cannot connect accounts until it is set.</p>
*/
@java.lang.Override
@JsonSetter(value = "client_id", nulls = Nulls.SKIP)
public _FinalStage clientId(Optional<String> clientId) {
this.clientId = clientId;
return this;
}

@java.lang.Override
public CreateOauthAppOpts build() {
return new CreateOauthAppOpts(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Optional<String> getDescription() {
}

/**
* @return The OAuth client ID registered with the upstream provider
* @return The OAuth client ID registered with the upstream provider. Blank values are ignored and the existing client ID is kept.
*/
@JsonProperty("client_id")
public Optional<String> getClientId() {
Expand Down Expand Up @@ -193,7 +193,7 @@ public Builder description(String description) {
}

/**
* <p>The OAuth client ID registered with the upstream provider</p>
* <p>The OAuth client ID registered with the upstream provider. Blank values are ignored and the existing client ID is kept.</p>
*/
@JsonSetter(value = "client_id", nulls = Nulls.SKIP)
public Builder clientId(Optional<String> clientId) {
Expand Down
72 changes: 37 additions & 35 deletions src/main/java/com/pipedream/api/types/OauthApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public final class OauthApp {
private final Optional<String> id;

private final String clientId;
private final Optional<String> clientId;

private final Optional<List<String>> scopes;

Expand Down Expand Up @@ -62,7 +62,7 @@ public final class OauthApp {

private OauthApp(
Optional<String> id,
String clientId,
Optional<String> clientId,
Optional<List<String>> scopes,
Optional<List<String>> additionalScopes,
Optional<String> redirectUri,
Expand Down Expand Up @@ -108,10 +108,10 @@ public Optional<String> getId() {
}

/**
* @return The OAuth client ID registered with the upstream provider
* @return The OAuth client ID registered with the upstream provider. Null for a client registered before its provider issued credentials.
*/
@JsonProperty("client_id")
public String getClientId() {
public Optional<String> getClientId() {
return clientId;
}

Expand Down Expand Up @@ -284,24 +284,17 @@ public String toString() {
return ObjectMappers.stringify(this);
}

public static ClientIdStage builder() {
public static OwnerIdStage builder() {
return new Builder();
}

public interface ClientIdStage {
/**
* <p>The OAuth client ID registered with the upstream provider</p>
*/
OwnerIdStage clientId(@NotNull String clientId);

Builder from(OauthApp other);
}

public interface OwnerIdStage {
/**
* <p>Hash ID of the owner: the workspace (o_...) or the project (proj_...)</p>
*/
NameSlugStage ownerId(@NotNull String ownerId);

Builder from(OauthApp other);
}

public interface NameSlugStage {
Expand Down Expand Up @@ -346,6 +339,13 @@ public interface _FinalStage {

_FinalStage id(String id);

/**
* <p>The OAuth client ID registered with the upstream provider. Null for a client registered before its provider issued credentials.</p>
*/
_FinalStage clientId(Optional<String> clientId);

_FinalStage clientId(String clientId);

/**
* <p>OAuth scopes requested when users connect through this client</p>
*/
Expand Down Expand Up @@ -414,15 +414,7 @@ public interface _FinalStage {

@JsonIgnoreProperties(ignoreUnknown = true)
public static final class Builder
implements ClientIdStage,
OwnerIdStage,
NameSlugStage,
NameStage,
ImgSrcStage,
FeaturedWeightStage,
_FinalStage {
private String clientId;

implements OwnerIdStage, NameSlugStage, NameStage, ImgSrcStage, FeaturedWeightStage, _FinalStage {
private String ownerId;

private String nameSlug;
Expand Down Expand Up @@ -453,6 +445,8 @@ public static final class Builder

private Optional<List<String>> scopes = Optional.empty();

private Optional<String> clientId = Optional.empty();

private Optional<String> id = Optional.empty();

@JsonAnySetter
Expand Down Expand Up @@ -482,18 +476,6 @@ public Builder from(OauthApp other) {
return this;
}

/**
* <p>The OAuth client ID registered with the upstream provider</p>
* <p>The OAuth client ID registered with the upstream provider</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
@JsonSetter("client_id")
public OwnerIdStage clientId(@NotNull String clientId) {
this.clientId = Objects.requireNonNull(clientId, "clientId must not be null");
return this;
}

/**
* <p>Hash ID of the owner: the workspace (o_...) or the project (proj_...)</p>
* <p>Hash ID of the owner: the workspace (o_...) or the project (proj_...)</p>
Expand Down Expand Up @@ -763,6 +745,26 @@ public _FinalStage scopes(Optional<List<String>> scopes) {
return this;
}

/**
* <p>The OAuth client ID registered with the upstream provider. Null for a client registered before its provider issued credentials.</p>
* @return Reference to {@code this} so that method calls can be chained together.
*/
@java.lang.Override
public _FinalStage clientId(String clientId) {
this.clientId = Optional.ofNullable(clientId);
return this;
}

/**
* <p>The OAuth client ID registered with the upstream provider. Null for a client registered before its provider issued credentials.</p>
*/
@java.lang.Override
@JsonSetter(value = "client_id", nulls = Nulls.SKIP)
public _FinalStage clientId(Optional<String> clientId) {
this.clientId = clientId;
return this;
}

/**
* <p>Hash ID for the OAuth client</p>
* @return Reference to {@code this} so that method calls can be chained together.
Expand Down
Loading