# typed: strict # frozen_string_literal: true module Setsuzoku module Service module WebService module Credentials module UsesTokenCredential extend T::Sig extend T::Helpers # The base auth url for the plugin. # # @return [String] the auth url. sig { abstract.returns(String) } def auth_base_url; end # The token to use for the credential. # # @return [String] the credential's token. sig{ abstract.returns(T.nilable(String)) } def token; end # The token to set for the credential. # # @return [String] the credential's token to set. # sig{ abstract.params(val: String).returns(T.nilable(String)) } def token=(val); end # The refresh token to use for the credential. # # @return [String] the credential's refresh token. sig{ abstract.returns(T.nilable(String)) } def refresh_token; end # The refresh token to set for the credential. # # @return [String] the credential's refresh token to set. # sig{ abstract.params(val: String).returns(T.nilable(String)) } def refresh_token=(val); end # The time the currently valid token expires on. # # @return [Datetime] the time the current token expires. sig{ abstract.returns(T.nilable(DateTime)) } def expires_on; end # The time to set for when the token expires on. # # @return [Datetime] the time to set for the current token's expiry. sig{ abstract.params(val: DateTime).returns(T.nilable(DateTime)) } def expires_on=(val); end # All credentials must have some implementation of storing their token details. # # @param resp [Setsuzoku::ApiResponse] the response hash from the external api call for a token. # @param attrs [Hash] additional attrs to be passed to super if desired. # # @return [Hash] the attributes to assign to the credential. sig { abstract.params(resp: Setsuzoku::ApiResponse, attrs: T::Hash[Symbol, T.untyped]).void } def set_token!; end end end end end end