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 Details

    • from

      public final OAuthCredentials.Builder from(OAuthCredentialsIF instance)
      Fill a builder with attribute values from the provided OAuthCredentialsIF instance. 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:
      this builder for use in a chained invocation
    • setAccessToken

      public final OAuthCredentials.Builder setAccessToken(String accessToken)
      Initializes the value for the accessToken attribute.
      Parameters:
      accessToken - The value for accessToken
      Returns:
      this builder for use in a chained invocation
    • setTeamName

      public final OAuthCredentials.Builder setTeamName(String teamName)
      Initializes the value for the teamName attribute.
      Parameters:
      teamName - The value for teamName
      Returns:
      this builder for use in a chained invocation
    • setTeamId

      public final OAuthCredentials.Builder setTeamId(String teamId)
      Initializes the value for the teamId attribute.
      Parameters:
      teamId - The value for teamId
      Returns:
      this builder for use in a chained invocation
    • setScope

      public final OAuthCredentials.Builder setScope(@Nullable String scope)
      Initializes the optional value scope to scope.
      Parameters:
      scope - The value for scope, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setScope

      public final OAuthCredentials.Builder setScope(Optional<String> scope)
      Initializes the optional value scope to scope.
      Parameters:
      scope - The value for scope
      Returns:
      this builder for use in a chained invocation
    • setUserId

      public final OAuthCredentials.Builder setUserId(@Nullable String userId)
      Initializes the optional value userId to userId.
      Parameters:
      userId - The value for userId, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setUserId

      public final OAuthCredentials.Builder setUserId(Optional<String> userId)
      Initializes the optional value userId to userId.
      Parameters:
      userId - The value for userId
      Returns:
      this builder for use in a chained invocation
    • setBot

      public final OAuthCredentials.Builder setBot(@Nullable BotCredentials bot)
      Initializes the optional value bot to bot.
      Parameters:
      bot - The value for bot, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setBot

      public final OAuthCredentials.Builder setBot(Optional<? extends BotCredentials> bot)
      Initializes the optional value bot to bot.
      Parameters:
      bot - The value for bot
      Returns:
      this builder for use in a chained invocation
    • setIncomingWebhook

      public final OAuthCredentials.Builder setIncomingWebhook(@Nullable IncomingWebhook incomingWebhook)
      Initializes the optional value incomingWebhook to incomingWebhook.
      Parameters:
      incomingWebhook - The value for incomingWebhook, null is accepted as java.util.Optional.empty()
      Returns:
      this builder for chained invocation
    • setIncomingWebhook

      public final OAuthCredentials.Builder setIncomingWebhook(Optional<? extends IncomingWebhook> incomingWebhook)
      Initializes the optional value incomingWebhook to incomingWebhook.
      Parameters:
      incomingWebhook - The value for incomingWebhook
      Returns:
      this builder for use in a chained invocation
    • build

      public OAuthCredentials build()
      Builds a new OAuthCredentials.
      Returns:
      An immutable instance of OAuthCredentials
      Throws:
      com.hubspot.immutables.validation.InvalidImmutableStateException - if any required attributes are missing