Class: Cloudflare::Artifacts::Tokens
- Inherits:
-
Object
- Object
- Cloudflare::Artifacts::Tokens
- Defined in:
- lib/cloudflare/artifacts/tokens.rb
Instance Method Summary collapse
- #create(repo:, scope:, ttl:, namespace: nil) ⇒ Object
-
#initialize(client) ⇒ Tokens
constructor
A new instance of Tokens.
- #revoke(id, namespace: nil) ⇒ Object
Constructor Details
#initialize(client) ⇒ Tokens
Returns a new instance of Tokens.
6 7 8 |
# File 'lib/cloudflare/artifacts/tokens.rb', line 6 def initialize(client) @client = client end |
Instance Method Details
#create(repo:, scope:, ttl:, namespace: nil) ⇒ Object
10 11 12 |
# File 'lib/cloudflare/artifacts/tokens.rb', line 10 def create(repo:, scope:, ttl:, namespace: nil) @client.post("/tokens", body: { repo: repo, scope: scope, ttl: ttl }, namespace: namespace) end |
#revoke(id, namespace: nil) ⇒ Object
14 15 16 |
# File 'lib/cloudflare/artifacts/tokens.rb', line 14 def revoke(id, namespace: nil) @client.delete("/tokens/#{id}", namespace: namespace) end |