Class: HatchetSdkRest::FeatureFlagsApi
- Inherits:
-
Object
- Object
- HatchetSdkRest::FeatureFlagsApi
- Defined in:
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/feature_flags_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ FeatureFlagsApi
constructor
A new instance of FeatureFlagsApi.
-
#tenant_feature_flag_evaluate(tenant, feature_flag_id, is_enabled_if_no_posthog, opts = {}) ⇒ FeatureFlagEvaluationResult
Evaluate a feature flag for a tenant Evaluate a feature flag for a tenant.
-
#tenant_feature_flag_evaluate_with_http_info(tenant, feature_flag_id, is_enabled_if_no_posthog, opts = {}) ⇒ Array<(FeatureFlagEvaluationResult, Integer, Hash)>
Evaluate a feature flag for a tenant Evaluate a feature flag for a tenant.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ FeatureFlagsApi
Returns a new instance of FeatureFlagsApi.
19 20 21 |
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/feature_flags_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/feature_flags_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#tenant_feature_flag_evaluate(tenant, feature_flag_id, is_enabled_if_no_posthog, opts = {}) ⇒ FeatureFlagEvaluationResult
Evaluate a feature flag for a tenant Evaluate a feature flag for a tenant
29 30 31 32 |
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/feature_flags_api.rb', line 29 def tenant_feature_flag_evaluate(tenant, feature_flag_id, is_enabled_if_no_posthog, opts = {}) data, _status_code, _headers = tenant_feature_flag_evaluate_with_http_info(tenant, feature_flag_id, is_enabled_if_no_posthog, opts) data end |
#tenant_feature_flag_evaluate_with_http_info(tenant, feature_flag_id, is_enabled_if_no_posthog, opts = {}) ⇒ Array<(FeatureFlagEvaluationResult, Integer, Hash)>
Evaluate a feature flag for a tenant Evaluate a feature flag for a tenant
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/feature_flags_api.rb', line 41 def tenant_feature_flag_evaluate_with_http_info(tenant, feature_flag_id, is_enabled_if_no_posthog, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FeatureFlagsApi.tenant_feature_flag_evaluate ...' end # verify the required parameter 'tenant' is set if @api_client.config.client_side_validation && tenant.nil? fail ArgumentError, "Missing the required parameter 'tenant' when calling FeatureFlagsApi.tenant_feature_flag_evaluate" end if @api_client.config.client_side_validation && tenant.to_s.length > 36 fail ArgumentError, 'invalid value for "tenant" when calling FeatureFlagsApi.tenant_feature_flag_evaluate, the character length must be smaller than or equal to 36.' end if @api_client.config.client_side_validation && tenant.to_s.length < 36 fail ArgumentError, 'invalid value for "tenant" when calling FeatureFlagsApi.tenant_feature_flag_evaluate, the character length must be greater than or equal to 36.' end # verify the required parameter 'feature_flag_id' is set if @api_client.config.client_side_validation && feature_flag_id.nil? fail ArgumentError, "Missing the required parameter 'feature_flag_id' when calling FeatureFlagsApi.tenant_feature_flag_evaluate" end # verify the required parameter 'is_enabled_if_no_posthog' is set if @api_client.config.client_side_validation && is_enabled_if_no_posthog.nil? fail ArgumentError, "Missing the required parameter 'is_enabled_if_no_posthog' when calling FeatureFlagsApi.tenant_feature_flag_evaluate" end # resource path local_var_path = '/api/v1/tenants/{tenant}/feature-flags'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'featureFlagId'] = feature_flag_id query_params[:'isEnabledIfNoPosthog'] = is_enabled_if_no_posthog # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'FeatureFlagEvaluationResult' # auth_names auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth'] = opts.merge( :operation => :"FeatureFlagsApi.tenant_feature_flag_evaluate", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FeatureFlagsApi#tenant_feature_flag_evaluate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |