diff --git a/lib/stytch/b2b_client.rb b/lib/stytch/b2b_client.rb index 8dec440..721941e 100644 --- a/lib/stytch/b2b_client.rb +++ b/lib/stytch/b2b_client.rb @@ -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) @@ -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) diff --git a/lib/stytch/client.rb b/lib/stytch/client.rb index 9b42f8b..1d9bf1a 100644 --- a/lib/stytch/client.rb +++ b/lib/stytch/client.rb @@ -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' @@ -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) @@ -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) diff --git a/lib/stytch/project.rb b/lib/stytch/project.rb new file mode 100644 index 0000000..e64b5b3 --- /dev/null +++ b/lib/stytch/project.rb @@ -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