Class OAuthCredentials.Builder
java.lang.Object
com.hubspot.slack.client.models.auth.OAuthCredentials.Builder
- Enclosing class:
OAuthCredentials
@Generated(from="OAuthCredentialsIF",
generator="Immutables")
@NotThreadSafe
public static final class OAuthCredentials.Builder
extends Object
Builds instances of type
OAuthCredentials.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newOAuthCredentials.final OAuthCredentials.Builderfrom(OAuthCredentialsIF instance) Fill a builder with attribute values from the providedOAuthCredentialsIFinstance.final OAuthCredentials.BuildersetAccessToken(String accessToken) Initializes the value for theaccessTokenattribute.final OAuthCredentials.BuildersetBot(BotCredentials bot) Initializes the optional valuebotto bot.final OAuthCredentials.BuildersetBot(Optional<? extends BotCredentials> bot) Initializes the optional valuebotto bot.final OAuthCredentials.BuildersetIncomingWebhook(IncomingWebhook incomingWebhook) Initializes the optional valueincomingWebhookto incomingWebhook.final OAuthCredentials.BuildersetIncomingWebhook(Optional<? extends IncomingWebhook> incomingWebhook) Initializes the optional valueincomingWebhookto incomingWebhook.final OAuthCredentials.BuilderInitializes the optional valuescopeto scope.final OAuthCredentials.BuilderInitializes the optional valuescopeto scope.final OAuthCredentials.BuilderInitializes the value for theteamIdattribute.final OAuthCredentials.BuildersetTeamName(String teamName) Initializes the value for theteamNameattribute.final OAuthCredentials.BuilderInitializes the optional valueuserIdto userId.final OAuthCredentials.BuilderInitializes the optional valueuserIdto userId.
-
Method Details
-
from
Fill a builder with attribute values from the providedOAuthCredentialsIFinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setAccessToken
Initializes the value for theaccessTokenattribute.- Parameters:
accessToken- The value for accessToken- Returns:
thisbuilder for use in a chained invocation
-
setTeamName
Initializes the value for theteamNameattribute.- Parameters:
teamName- The value for teamName- Returns:
thisbuilder for use in a chained invocation
-
setTeamId
Initializes the value for theteamIdattribute.- Parameters:
teamId- The value for teamId- Returns:
thisbuilder for use in a chained invocation
-
setScope
Initializes the optional valuescopeto scope.- Parameters:
scope- The value for scope,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setScope
Initializes the optional valuescopeto scope.- Parameters:
scope- The value for scope- Returns:
thisbuilder for use in a chained invocation
-
setUserId
Initializes the optional valueuserIdto userId.- Parameters:
userId- The value for userId,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setUserId
Initializes the optional valueuserIdto userId.- Parameters:
userId- The value for userId- Returns:
thisbuilder for use in a chained invocation
-
setBot
Initializes the optional valuebotto bot.- Parameters:
bot- The value for bot,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setBot
Initializes the optional valuebotto bot.- Parameters:
bot- The value for bot- Returns:
thisbuilder for use in a chained invocation
-
setIncomingWebhook
Initializes the optional valueincomingWebhookto incomingWebhook.- Parameters:
incomingWebhook- The value for incomingWebhook,nullis accepted asjava.util.Optional.empty()- Returns:
thisbuilder for chained invocation
-
setIncomingWebhook
public final OAuthCredentials.Builder setIncomingWebhook(Optional<? extends IncomingWebhook> incomingWebhook) Initializes the optional valueincomingWebhookto incomingWebhook.- Parameters:
incomingWebhook- The value for incomingWebhook- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newOAuthCredentials.- Returns:
- An immutable instance of OAuthCredentials
- Throws:
com.hubspot.immutables.validation.InvalidImmutableStateException- if any required attributes are missing
-