Class: DependencyTracker::ComponentApi

Inherits:
Object
  • Object
show all
Defined in:
lib/dependency-tracker-client/api/component_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ComponentApi

Returns a new instance of ComponentApi.



19
20
21
# File 'lib/dependency-tracker-client/api/component_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/dependency-tracker-client/api/component_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_component(opts = {}) ⇒ Component

Creates a new component

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



26
27
28
29
# File 'lib/dependency-tracker-client/api/component_api.rb', line 26

def create_component(opts = {})
  data, _status_code, _headers = create_component_with_http_info(opts)
  data
end

#create_component_with_http_info(opts = {}) ⇒ Array<(Component, Integer, Hash)>

Creates a new component

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Component data, response status code and response headers



35
36
37
38
39
40
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
# File 'lib/dependency-tracker-client/api/component_api.rb', line 35

def create_component_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ComponentApi.create_component ...'
  end
  # resource path
  local_var_path = '/v1/component'

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) 

  # return_type
  return_type = opts[:return_type] || 'Component' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#delete_component(uuid, opts = {}) ⇒ nil

Deletes a component

Parameters:

  • uuid (String)

    The UUID of the component to delete

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

    the optional parameters

Returns:

  • (nil)


84
85
86
87
# File 'lib/dependency-tracker-client/api/component_api.rb', line 84

def delete_component(uuid, opts = {})
  delete_component_with_http_info(uuid, opts)
  nil
end

#delete_component_with_http_info(uuid, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Deletes a component

Parameters:

  • uuid (String)

    The UUID of the component to delete

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/dependency-tracker-client/api/component_api.rb', line 93

def delete_component_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ComponentApi.delete_component ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling ComponentApi.delete_component"
  end
  # resource path
  local_var_path = '/v1/component/{uuid}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#get_all_components(opts = {}) ⇒ Array<Component>

Returns a list of all components

Parameters:

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

    the optional parameters

Returns:



141
142
143
144
# File 'lib/dependency-tracker-client/api/component_api.rb', line 141

def get_all_components(opts = {})
  data, _status_code, _headers = get_all_components_with_http_info(opts)
  data
end

#get_all_components_with_http_info(opts = {}) ⇒ Array<(Array<Component>, Integer, Hash)>

Returns a list of all components

Parameters:

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

    the optional parameters

Returns:

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

    Array<Component> data, response status code and response headers



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
182
183
184
185
186
187
188
189
190
# File 'lib/dependency-tracker-client/api/component_api.rb', line 149

def get_all_components_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ComponentApi.get_all_components ...'
  end
  # resource path
  local_var_path = '/v1/component'

  # 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[:body] 

  # return_type
  return_type = opts[:return_type] || 'Array<Component>' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#get_component_by_hash(hash, opts = {}) ⇒ Component

Returns a specific component

Parameters:

  • hash (String)

    The MD5, SHA-1, SHA-256, SHA-512, SHA3-256, or SHA3-512 hash of the component to retrieve

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

    the optional parameters

Returns:



196
197
198
199
# File 'lib/dependency-tracker-client/api/component_api.rb', line 196

def get_component_by_hash(hash, opts = {})
  data, _status_code, _headers = get_component_by_hash_with_http_info(hash, opts)
  data
end

#get_component_by_hash_with_http_info(hash, opts = {}) ⇒ Array<(Component, Integer, Hash)>

Returns a specific component

Parameters:

  • hash (String)

    The MD5, SHA-1, SHA-256, SHA-512, SHA3-256, or SHA3-512 hash of the component to retrieve

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

    the optional parameters

Returns:

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

    Component data, response status code and response headers



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
# File 'lib/dependency-tracker-client/api/component_api.rb', line 205

def get_component_by_hash_with_http_info(hash, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ComponentApi.get_component_by_hash ...'
  end
  # verify the required parameter 'hash' is set
  if @api_client.config.client_side_validation && hash.nil?
    fail ArgumentError, "Missing the required parameter 'hash' when calling ComponentApi.get_component_by_hash"
  end
  # resource path
  local_var_path = '/v1/component/hash/{hash}'.sub('{' + 'hash' + '}', CGI.escape(hash.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[:body] 

  # return_type
  return_type = opts[:return_type] || 'Component' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#get_component_by_uuid(uuid, opts = {}) ⇒ Component

Returns a specific component

Parameters:

  • uuid (String)

    The UUID of the component to retrieve

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

    the optional parameters

Returns:



256
257
258
259
# File 'lib/dependency-tracker-client/api/component_api.rb', line 256

def get_component_by_uuid(uuid, opts = {})
  data, _status_code, _headers = get_component_by_uuid_with_http_info(uuid, opts)
  data
end

#get_component_by_uuid_with_http_info(uuid, opts = {}) ⇒ Array<(Component, Integer, Hash)>

Returns a specific component

Parameters:

  • uuid (String)

    The UUID of the component to retrieve

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

    the optional parameters

Returns:

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

    Component data, response status code and response headers



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
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
# File 'lib/dependency-tracker-client/api/component_api.rb', line 265

def get_component_by_uuid_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ComponentApi.get_component_by_uuid ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling ComponentApi.get_component_by_uuid"
  end
  # resource path
  local_var_path = '/v1/component/{uuid}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.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[:body] 

  # return_type
  return_type = opts[:return_type] || 'Component' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#identify_internal_components(opts = {}) ⇒ nil

Requests the identification of internal components in the portfolio

Parameters:

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

    the optional parameters

Returns:

  • (nil)


315
316
317
318
# File 'lib/dependency-tracker-client/api/component_api.rb', line 315

def identify_internal_components(opts = {})
  identify_internal_components_with_http_info(opts)
  nil
end

#identify_internal_components_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Requests the identification of internal components in the portfolio

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/dependency-tracker-client/api/component_api.rb', line 323

def identify_internal_components_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ComponentApi.identify_internal_components ...'
  end
  # resource path
  local_var_path = '/v1/component/internal/identify'

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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

#update_component(opts = {}) ⇒ Component

Updates a component

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



368
369
370
371
# File 'lib/dependency-tracker-client/api/component_api.rb', line 368

def update_component(opts = {})
  data, _status_code, _headers = update_component_with_http_info(opts)
  data
end

#update_component_with_http_info(opts = {}) ⇒ Array<(Component, Integer, Hash)>

Updates a component

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    Component data, response status code and response headers



377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/dependency-tracker-client/api/component_api.rb', line 377

def update_component_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ComponentApi.update_component ...'
  end
  # resource path
  local_var_path = '/v1/component'

  # 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'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) 

  # return_type
  return_type = opts[:return_type] || 'Component' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

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