# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. # typed: true # frozen_string_literal: true require 'faraday' require 'faraday/multipart' require 'sorbet-runtime' module SpeakeasyClientSDK extend T::Sig class Workspaces extend T::Sig sig { params(sdk_config: SDKConfiguration).void } def initialize(sdk_config) @sdk_configuration = sdk_config end sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetWorkspaceRequest)).returns(::SpeakeasyClientSDK::Operations::GetWorkspaceResponse) } def get_workspace(request) # get_workspace - Get workspace # Get information about a particular workspace. url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::SpeakeasyClientSDK::Operations::GetWorkspaceRequest, base_url, '/v1/workspace/{workspaceID}', request, @sdk_configuration.globals ) headers = {} headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::SpeakeasyClientSDK::Operations::GetWorkspaceResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::SpeakeasyClientSDK::Shared::Workspace) res.workspace = out end else if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::SpeakeasyClientSDK::Shared::Error) res.error = out end end res end sig { params(request: T.nilable(::SpeakeasyClientSDK::Operations::GetWorkspaceFeatureFlagsRequest)).returns(::SpeakeasyClientSDK::Operations::GetWorkspaceFeatureFlagsResponse) } def get_workspace_feature_flags(request) # get_workspace_feature_flags - Get workspace feature flags url, params = @sdk_configuration.get_server_details base_url = Utils.template_url(url, params) url = Utils.generate_url( ::SpeakeasyClientSDK::Operations::GetWorkspaceFeatureFlagsRequest, base_url, '/v1/workspace/{workspaceID}/feature_flags', request, @sdk_configuration.globals ) headers = {} headers['Accept'] = 'application/json' headers['user-agent'] = @sdk_configuration.user_agent r = @sdk_configuration.client.get(url) do |req| req.headers = headers Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? end content_type = r.headers.fetch('Content-Type', 'application/octet-stream') res = ::SpeakeasyClientSDK::Operations::GetWorkspaceFeatureFlagsResponse.new( status_code: r.status, content_type: content_type, raw_response: r ) if r.status == 200 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::SpeakeasyClientSDK::Shared::WorkspaceFeatureFlagResponse) res.workspace_feature_flag_response = out end elsif r.status >= 500 && r.status < 600 if Utils.match_content_type(content_type, 'application/json') out = Utils.unmarshal_complex(r.env.response_body, ::SpeakeasyClientSDK::Shared::Error) res.error = out end end res end end end