Class: LaunchDarklyApi::SegmentsBetaApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SegmentsBetaApi

Returns a new instance of SegmentsBetaApi.



19
20
21
# File 'lib/launchdarkly_api/api/segments_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/segments_beta_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_big_segment_export(project_key, environment_key, segment_key, opts = {}) ⇒ nil

Create Big Segment export Starts a new export process for a Big Segment

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • segment_key (String)

    The segment key

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

    the optional parameters

Returns:

  • (nil)


29
30
31
32
# File 'lib/launchdarkly_api/api/segments_beta_api.rb', line 29

def create_big_segment_export(project_key, environment_key, segment_key, opts = {})
  create_big_segment_export_with_http_info(project_key, environment_key, segment_key, opts)
  nil
end

#create_big_segment_export_with_http_info(project_key, environment_key, segment_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Create Big Segment export Starts a new export process for a Big Segment

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • segment_key (String)

    The segment key

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/launchdarkly_api/api/segments_beta_api.rb', line 41

def create_big_segment_export_with_http_info(project_key, environment_key, segment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SegmentsBetaApi.create_big_segment_export ...'
  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 SegmentsBetaApi.create_big_segment_export"
  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 SegmentsBetaApi.create_big_segment_export"
  end
  # verify the required parameter 'segment_key' is set
  if @api_client.config.client_side_validation && segment_key.nil?
    fail ArgumentError, "Missing the required parameter 'segment_key' when calling SegmentsBetaApi.create_big_segment_export"
  end
  # resource path
  local_var_path = '/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'segmentKey' + '}', CGI.escape(segment_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

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

#create_big_segment_import(project_key, environment_key, segment_key, opts = {}) ⇒ nil

Create Big Segment import Start a new import process for a Big Segment.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • segment_key (String)

    The segment key

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    CSV file containing keys

  • :mode (String)

    Import mode. Use either &#x60;merge&#x60; or &#x60;replace&#x60;

Returns:

  • (nil)


106
107
108
109
# File 'lib/launchdarkly_api/api/segments_beta_api.rb', line 106

def create_big_segment_import(project_key, environment_key, segment_key, opts = {})
  create_big_segment_import_with_http_info(project_key, environment_key, segment_key, opts)
  nil
end

#create_big_segment_import_with_http_info(project_key, environment_key, segment_key, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Create Big Segment import Start a new import process for a Big Segment.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • segment_key (String)

    The segment key

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    CSV file containing keys

  • :mode (String)

    Import mode. Use either &#x60;merge&#x60; or &#x60;replace&#x60;

Returns:

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

    nil, response status code and response headers



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/launchdarkly_api/api/segments_beta_api.rb', line 120

def create_big_segment_import_with_http_info(project_key, environment_key, segment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SegmentsBetaApi.create_big_segment_import ...'
  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 SegmentsBetaApi.create_big_segment_import"
  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 SegmentsBetaApi.create_big_segment_import"
  end
  # verify the required parameter 'segment_key' is set
  if @api_client.config.client_side_validation && segment_key.nil?
    fail ArgumentError, "Missing the required parameter 'segment_key' when calling SegmentsBetaApi.create_big_segment_import"
  end
  # resource path
  local_var_path = '/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'segmentKey' + '}', CGI.escape(segment_key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['file'] = opts[:'file'] if !opts[:'file'].nil?
  form_params['mode'] = opts[:'mode'] if !opts[:'mode'].nil?

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

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

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

#get_big_segment_export(project_key, environment_key, segment_key, export_id, opts = {}) ⇒ Export

Get Big Segment export Returns info about a Big Segment export process.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • segment_key (String)

    The segment key

  • export_id (String)

    The export ID

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

    the optional parameters

Returns:



191
192
193
194
# File 'lib/launchdarkly_api/api/segments_beta_api.rb', line 191

def get_big_segment_export(project_key, environment_key, segment_key, export_id, opts = {})
  data, _status_code, _headers = get_big_segment_export_with_http_info(project_key, environment_key, segment_key, export_id, opts)
  data
end

#get_big_segment_export_with_http_info(project_key, environment_key, segment_key, export_id, opts = {}) ⇒ Array<(Export, Integer, Hash)>

Get Big Segment export Returns info about a Big Segment export process.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • segment_key (String)

    The segment key

  • export_id (String)

    The export ID

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

    the optional parameters

Returns:

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

    Export data, response status code and response headers



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/launchdarkly_api/api/segments_beta_api.rb', line 204

def get_big_segment_export_with_http_info(project_key, environment_key, segment_key, export_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SegmentsBetaApi.get_big_segment_export ...'
  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 SegmentsBetaApi.get_big_segment_export"
  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 SegmentsBetaApi.get_big_segment_export"
  end
  # verify the required parameter 'segment_key' is set
  if @api_client.config.client_side_validation && segment_key.nil?
    fail ArgumentError, "Missing the required parameter 'segment_key' when calling SegmentsBetaApi.get_big_segment_export"
  end
  # verify the required parameter 'export_id' is set
  if @api_client.config.client_side_validation && export_id.nil?
    fail ArgumentError, "Missing the required parameter 'export_id' when calling SegmentsBetaApi.get_big_segment_export"
  end
  # resource path
  local_var_path = '/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports/{exportID}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'segmentKey' + '}', CGI.escape(segment_key.to_s)).sub('{' + 'exportID' + '}', CGI.escape(export_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Export'

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

  new_options = opts.merge(
    :operation => :"SegmentsBetaApi.get_big_segment_export",
    :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: SegmentsBetaApi#get_big_segment_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_big_segment_import(project_key, environment_key, segment_key, import_id, opts = {}) ⇒ Import

Get Big Segment import Returns info about a Big Segment import process.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • segment_key (String)

    The segment key

  • import_id (String)

    The import ID

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

    the optional parameters

Returns:



272
273
274
275
# File 'lib/launchdarkly_api/api/segments_beta_api.rb', line 272

def get_big_segment_import(project_key, environment_key, segment_key, import_id, opts = {})
  data, _status_code, _headers = get_big_segment_import_with_http_info(project_key, environment_key, segment_key, import_id, opts)
  data
end

#get_big_segment_import_with_http_info(project_key, environment_key, segment_key, import_id, opts = {}) ⇒ Array<(Import, Integer, Hash)>

Get Big Segment import Returns info about a Big Segment import process.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • segment_key (String)

    The segment key

  • import_id (String)

    The import ID

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

    the optional parameters

Returns:

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

    Import data, response status code and response headers



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/launchdarkly_api/api/segments_beta_api.rb', line 285

def get_big_segment_import_with_http_info(project_key, environment_key, segment_key, import_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SegmentsBetaApi.get_big_segment_import ...'
  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 SegmentsBetaApi.get_big_segment_import"
  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 SegmentsBetaApi.get_big_segment_import"
  end
  # verify the required parameter 'segment_key' is set
  if @api_client.config.client_side_validation && segment_key.nil?
    fail ArgumentError, "Missing the required parameter 'segment_key' when calling SegmentsBetaApi.get_big_segment_import"
  end
  # verify the required parameter 'import_id' is set
  if @api_client.config.client_side_validation && import_id.nil?
    fail ArgumentError, "Missing the required parameter 'import_id' when calling SegmentsBetaApi.get_big_segment_import"
  end
  # resource path
  local_var_path = '/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports/{importID}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'environmentKey' + '}', CGI.escape(environment_key.to_s)).sub('{' + 'segmentKey' + '}', CGI.escape(segment_key.to_s)).sub('{' + 'importID' + '}', CGI.escape(import_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Import'

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

  new_options = opts.merge(
    :operation => :"SegmentsBetaApi.get_big_segment_import",
    :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: SegmentsBetaApi#get_big_segment_import\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end