Class ApiKey

java.lang.Object
com.stripe.model.StripeObject
com.stripe.model.v2.iam.ApiKey
All Implemented Interfaces:
HasId, StripeObjectInterface

public class ApiKey extends StripeObject implements HasId
An API key.
  • Constructor Details

    • ApiKey

      public ApiKey()
  • Method Details

    • getCreated

      public Instant getCreated()
      Timestamp when the API key was created.
    • getExpiresAt

      public Instant getExpiresAt()
      Timestamp when the API key expires.
    • getIpAllowlist

      public List<String> getIpAllowlist()
      List of IP addresses allowed to use this API key. Addresses use IPv4 protocol, and may be a CIDR range (e.g., [100.10.38.255, 100.10.38.0/24]).
    • getLastUsed

      public Instant getLastUsed()
      Timestamp when the API key was last used.
    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getManagedBy

      public ApiKey.ManagedBy getManagedBy()
      Account that manages this API key (for keys managed by platforms).
    • getName

      public String getName()
      Name of the API key.
    • getNote

      public String getNote()
      Note or description for the API key.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value of the object field.

      Equal to v2.iam.api_key.

    • getPublishableKey

      public ApiKey.PublishableKey getPublishableKey()
      Token set for a publishable key.
    • getSecretKey

      public ApiKey.SecretKey getSecretKey()
      Token set for a secret key.
    • getStatus

      public String getStatus()
      Current status of the API key (e.g., active, expired).

      One of active, or expired.

    • getType

      public String getType()
      Type of the API key.

      One of publishable_key, or secret_key.

    • setCreated

      public void setCreated(Instant created)
      Timestamp when the API key was created.
    • setExpiresAt

      public void setExpiresAt(Instant expiresAt)
      Timestamp when the API key expires.
    • setId

      public void setId(String id)
      Unique identifier of the API key.
    • setIpAllowlist

      public void setIpAllowlist(List<String> ipAllowlist)
      List of IP addresses allowed to use this API key. Addresses use IPv4 protocol, and may be a CIDR range (e.g., [100.10.38.255, 100.10.38.0/24]).
    • setLastUsed

      public void setLastUsed(Instant lastUsed)
      Timestamp when the API key was last used.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setManagedBy

      public void setManagedBy(ApiKey.ManagedBy managedBy)
      Account that manages this API key (for keys managed by platforms).
    • setName

      public void setName(String name)
      Name of the API key.
    • setNote

      public void setNote(String note)
      Note or description for the API key.
    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value of the object field.

      Equal to v2.iam.api_key.

    • setPublishableKey

      public void setPublishableKey(ApiKey.PublishableKey publishableKey)
      Token set for a publishable key.
    • setSecretKey

      public void setSecretKey(ApiKey.SecretKey secretKey)
      Token set for a secret key.
    • setStatus

      public void setStatus(String status)
      Current status of the API key (e.g., active, expired).

      One of active, or expired.

    • setType

      public void setType(String type)
      Type of the API key.

      One of publishable_key, or secret_key.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier of the API key.
      Specified by:
      getId in interface HasId