Skip to content

Commit

Permalink
Project metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-stytch committed Apr 3, 2024
1 parent 858deda commit 7b203cf
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/stytch/b2b_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
require_relative 'b2b_sso'
require_relative 'b2b_totps'
require_relative 'm2m'
require_relative 'project'
require_relative 'rbac_local'

module StytchB2B
class Client
ENVIRONMENTS = %i[live test].freeze

attr_reader :discovery, :m2m, :magic_links, :oauth, :otps, :organizations, :passwords, :rbac, :recovery_codes, :scim, :sso, :sessions, :totps
attr_reader :discovery, :m2m, :magic_links, :oauth, :otps, :organizations, :passwords, :project, :rbac, :recovery_codes, :scim, :sso, :sessions, :totps

def initialize(project_id:, secret:, env: nil, &block)
@api_host = api_host(env, project_id)
Expand All @@ -38,6 +39,7 @@ def initialize(project_id:, secret:, env: nil, &block)
@otps = StytchB2B::OTPs.new(@connection)
@organizations = StytchB2B::Organizations.new(@connection)
@passwords = StytchB2B::Passwords.new(@connection)
@project = Stytch::Project.new(@connection)
@rbac = StytchB2B::RBAC.new(@connection)
@recovery_codes = StytchB2B::RecoveryCodes.new(@connection)
@scim = StytchB2B::SCIM.new(@connection)
Expand Down
4 changes: 3 additions & 1 deletion lib/stytch/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require_relative 'oauth'
require_relative 'otps'
require_relative 'passwords'
require_relative 'project'
require_relative 'sessions'
require_relative 'totps'
require_relative 'users'
Expand All @@ -15,7 +16,7 @@ module Stytch
class Client
ENVIRONMENTS = %i[live test].freeze

attr_reader :crypto_wallets, :m2m, :magic_links, :oauth, :otps, :passwords, :sessions, :totps, :users, :webauthn
attr_reader :crypto_wallets, :m2m, :magic_links, :oauth, :otps, :passwords, :project, :sessions, :totps, :users, :webauthn

def initialize(project_id:, secret:, env: nil, &block)
@api_host = api_host(env, project_id)
Expand All @@ -30,6 +31,7 @@ def initialize(project_id:, secret:, env: nil, &block)
@oauth = Stytch::OAuth.new(@connection)
@otps = Stytch::OTPs.new(@connection)
@passwords = Stytch::Passwords.new(@connection)
@project = Stytch::Project.new(@connection)
@sessions = Stytch::Sessions.new(@connection, @project_id)
@totps = Stytch::TOTPs.new(@connection)
@users = Stytch::Users.new(@connection)
Expand Down
26 changes: 26 additions & 0 deletions lib/stytch/project.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# frozen_string_literal: true

# !!!
# WARNING: This file is autogenerated
# Only modify code within MANUAL() sections
# or your changes may be overwritten later!
# !!!

require_relative 'request_helper'

module Stytch
class Project
include Stytch::RequestHelper

def initialize(connection)
@connection = connection
end

def metrics
headers = {}
query_params = {}
request = request_with_query_params('/v1/projects/metrics', query_params)
get_request(request, headers)
end
end
end

0 comments on commit 7b203cf

Please sign in to comment.