Class: LaunchDarklyApi::InsightsFlagEventsBetaApi

Inherits:
Object
  • Object
show all
Defined in:
lib/launchdarkly_api/api/insights_flag_events_beta_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ InsightsFlagEventsBetaApi

Returns a new instance of InsightsFlagEventsBetaApi.



19
20
21
# File 'lib/launchdarkly_api/api/insights_flag_events_beta_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/launchdarkly_api/api/insights_flag_events_beta_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_flag_events(project_key, environment_key, opts = {}) ⇒ FlagEventCollectionRep

List flag events Get a list of flag events ### Expanding the flag event collection response LaunchDarkly supports expanding the flag event collection response to include additional fields. To expand the response, append the expand query parameter and include the following: * experiments includes details on all of the experiments run on each flag For example, use ?expand=experiments to include the experiments field in the response. By default, this field is not included in the response.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :application_key (String)

    Comma separated list of application keys

  • :query (String)

    Filter events by flag key

  • :impact_size (String)

    Filter events by impact size. A small impact created a less than 20% change in the proportion of end users receiving one or more flag variations. A medium impact created between a 20%-80% change. A large impact created a more than 80% change. Options: `none`, `small`, `medium`, `large`

  • :has_experiments (Boolean)

    Filter events to those associated with an experiment (`true`) or without an experiment (`false`)

  • :global (String)

    Filter to include or exclude global events. Default value is `include`. Options: `include`, `exclude`

  • :expand (String)

    Expand properties in response. Options: `experiments`

  • :limit (Integer)

    The number of deployments to return. Default is 20. Maximum allowed is 100.

  • :from (Integer)

    Unix timestamp in milliseconds. Default value is 7 days ago.

  • :to (Integer)

    Unix timestamp in milliseconds. Default value is now.

  • :after (String)

    Identifier used for pagination

  • :before (String)

    Identifier used for pagination

Returns:



39
40
41
42
# File 'lib/launchdarkly_api/api/insights_flag_events_beta_api.rb', line 39

def get_flag_events(project_key, environment_key, opts = {})
  data, _status_code, _headers = get_flag_events_with_http_info(project_key, environment_key, opts)
  data
end

#get_flag_events_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(FlagEventCollectionRep, Integer, Hash)>

List flag events Get a list of flag events ### Expanding the flag event collection response LaunchDarkly supports expanding the flag event collection response to include additional fields. To expand the response, append the `expand` query parameter and include the following: * `experiments` includes details on all of the experiments run on each flag For example, use `?expand=experiments` to include the `experiments` field in the response. By default, this field is not included in the response.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :application_key (String)

    Comma separated list of application keys

  • :query (String)

    Filter events by flag key

  • :impact_size (String)

    Filter events by impact size. A small impact created a less than 20% change in the proportion of end users receiving one or more flag variations. A medium impact created between a 20%-80% change. A large impact created a more than 80% change. Options: `none`, `small`, `medium`, `large`

  • :has_experiments (Boolean)

    Filter events to those associated with an experiment (`true`) or without an experiment (`false`)

  • :global (String)

    Filter to include or exclude global events. Default value is `include`. Options: `include`, `exclude`

  • :expand (String)

    Expand properties in response. Options: `experiments`

  • :limit (Integer)

    The number of deployments to return. Default is 20. Maximum allowed is 100.

  • :from (Integer)

    Unix timestamp in milliseconds. Default value is 7 days ago.

  • :to (Integer)

    Unix timestamp in milliseconds. Default value is now.

  • :after (String)

    Identifier used for pagination

  • :before (String)

    Identifier used for pagination

Returns:

  • (Array<(FlagEventCollectionRep, Integer, Hash)>)

    FlagEventCollectionRep data, response status code and response headers



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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/launchdarkly_api/api/insights_flag_events_beta_api.rb', line 61

def get_flag_events_with_http_info(project_key, environment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsFlagEventsBetaApi.get_flag_events ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling InsightsFlagEventsBetaApi.get_flag_events"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling InsightsFlagEventsBetaApi.get_flag_events"
  end
  # resource path
  local_var_path = '/api/v2/engineering-insights/flag-events'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'projectKey'] = project_key
  query_params[:'environmentKey'] = environment_key
  query_params[:'applicationKey'] = opts[:'application_key'] if !opts[:'application_key'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
  query_params[:'impactSize'] = opts[:'impact_size'] if !opts[:'impact_size'].nil?
  query_params[:'hasExperiments'] = opts[:'has_experiments'] if !opts[:'has_experiments'].nil?
  query_params[:'global'] = opts[:'global'] if !opts[:'global'].nil?
  query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?

  # 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] || 'FlagEventCollectionRep'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"InsightsFlagEventsBetaApi.get_flag_events",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsFlagEventsBetaApi#get_flag_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end