Class OAuthCredentials

java.lang.Object
com.hubspot.slack.client.models.auth.OAuthCredentials
All Implemented Interfaces:
OAuthCredentialsIF

@Generated(from="OAuthCredentialsIF", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class OAuthCredentials extends Object implements OAuthCredentialsIF
Immutable implementation of OAuthCredentialsIF.

Use the builder to create immutable instances: OAuthCredentials.builder().

  • Method Details

    • getAccessToken

      public String getAccessToken()
      Specified by:
      getAccessToken in interface OAuthCredentialsIF
      Returns:
      The value of the accessToken attribute
    • getTeamName

      public String getTeamName()
      Specified by:
      getTeamName in interface OAuthCredentialsIF
      Returns:
      The value of the teamName attribute
    • getTeamId

      public String getTeamId()
      Specified by:
      getTeamId in interface OAuthCredentialsIF
      Returns:
      The value of the teamId attribute
    • getScope

      public Optional<String> getScope()
      Specified by:
      getScope in interface OAuthCredentialsIF
      Returns:
      The value of the scope attribute
    • getUserId

      public Optional<String> getUserId()
      Specified by:
      getUserId in interface OAuthCredentialsIF
      Returns:
      The value of the userId attribute
    • getBot

      public Optional<BotCredentials> getBot()
      Specified by:
      getBot in interface OAuthCredentialsIF
      Returns:
      The value of the bot attribute
    • getIncomingWebhook

      public Optional<IncomingWebhook> getIncomingWebhook()
      Specified by:
      getIncomingWebhook in interface OAuthCredentialsIF
      Returns:
      The value of the incomingWebhook attribute
    • withAccessToken

      public final OAuthCredentials withAccessToken(String value)
      Copy the current immutable object by setting a value for the accessToken attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for accessToken
      Returns:
      A modified copy or the this object
    • withTeamName

      public final OAuthCredentials withTeamName(String value)
      Copy the current immutable object by setting a value for the teamName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for teamName
      Returns:
      A modified copy or the this object
    • withTeamId

      public final OAuthCredentials withTeamId(String value)
      Copy the current immutable object by setting a value for the teamId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for teamId
      Returns:
      A modified copy or the this object
    • withScope

      public final OAuthCredentials withScope(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional scope attribute.
      Parameters:
      value - The value for scope, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withScope

      public final OAuthCredentials withScope(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the scope attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for scope
      Returns:
      A modified copy or this if not changed
    • withUserId

      public final OAuthCredentials withUserId(@Nullable String value)
      Copy the current immutable object by setting a present value for the optional userId attribute.
      Parameters:
      value - The value for userId, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withUserId

      public final OAuthCredentials withUserId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the userId attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for userId
      Returns:
      A modified copy or this if not changed
    • withBot

      public final OAuthCredentials withBot(@Nullable BotCredentials value)
      Copy the current immutable object by setting a present value for the optional bot attribute.
      Parameters:
      value - The value for bot, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withBot

      public final OAuthCredentials withBot(Optional<? extends BotCredentials> optional)
      Copy the current immutable object by setting an optional value for the bot attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for bot
      Returns:
      A modified copy or this if not changed
    • withIncomingWebhook

      public final OAuthCredentials withIncomingWebhook(@Nullable IncomingWebhook value)
      Copy the current immutable object by setting a present value for the optional incomingWebhook attribute.
      Parameters:
      value - The value for incomingWebhook, null is accepted as java.util.Optional.empty()
      Returns:
      A modified copy or this if not changed
    • withIncomingWebhook

      public final OAuthCredentials withIncomingWebhook(Optional<? extends IncomingWebhook> optional)
      Copy the current immutable object by setting an optional value for the incomingWebhook attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for incomingWebhook
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of OAuthCredentials that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: accessToken, teamName, teamId, scope, userId, bot, incomingWebhook.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value OAuthCredentials with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static OAuthCredentials copyOf(OAuthCredentialsIF instance)
      Creates an immutable copy of a OAuthCredentialsIF value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable OAuthCredentials instance
    • builder

      public static OAuthCredentials.Builder builder()
      Creates a builder for OAuthCredentials.
       OAuthCredentials.builder()
          .setAccessToken(String) // required accessToken
          .setTeamName(String) // required teamName
          .setTeamId(String) // required teamId
          .setScope(Optional<String>) // optional scope
          .setUserId(Optional<String>) // optional userId
          .setBot(Optional<BotCredentials>) // optional bot
          .setIncomingWebhook(Optional<IncomingWebhook>) // optional incomingWebhook
          .build();
       
      Returns:
      A new OAuthCredentials builder