Class: YkIosCmd::Request
- Inherits:
-
Object
- Object
- YkIosCmd::Request
- Includes:
- HTTParty
- Defined in:
- lib/yk_command/analyze/request.rb
Instance Method Summary collapse
- #append_deprecated_versions(name, versions) ⇒ Object
- #get_project_info(app_project_name) ⇒ Object
-
#initialize(config) ⇒ Request
constructor
A new instance of Request.
- #upload_app(app_list_data) ⇒ Object
- #upload_app_dependency(project_id, data) ⇒ Object
- #upload_component(data) ⇒ Object
- #upload_third_lib_project(data) ⇒ Object
Constructor Details
#initialize(config) ⇒ Request
Returns a new instance of Request.
8 9 10 11 12 13 |
# File 'lib/yk_command/analyze/request.rb', line 8 def initialize(config) @config = config # self.class.base_uri @config[:local] self.class.base_uri @config[:pro] puts "🍉 #{self.class.base_uri}" end |
Instance Method Details
#append_deprecated_versions(name, versions) ⇒ Object
36 37 38 39 |
# File 'lib/yk_command/analyze/request.rb', line 36 def append_deprecated_versions(name, versions) self.class.post('/project/updateDeprecatedVersions', body: { 'data' => { "name": name, "versions": versions } }.to_json) end |
#get_project_info(app_project_name) ⇒ Object
20 21 22 |
# File 'lib/yk_command/analyze/request.rb', line 20 def get_project_info(app_project_name) self.class.get('/project/projectByName', query: { 'name' => app_project_name }) end |
#upload_app(app_list_data) ⇒ Object
24 25 26 |
# File 'lib/yk_command/analyze/request.rb', line 24 def upload_app(app_list_data) self.class.post('/project/updateAllAppProjects', query: { "delete_depricated" => true }, body: { 'data' => app_list_data }.to_json) end |
#upload_app_dependency(project_id, data) ⇒ Object
15 16 17 18 |
# File 'lib/yk_command/analyze/request.rb', line 15 def upload_app_dependency(project_id, data) self.class.post('/dependency/addDependency', query: { 'projectId' => project_id }, body: { 'data' => data }.to_json) end |
#upload_component(data) ⇒ Object
28 29 30 |
# File 'lib/yk_command/analyze/request.rb', line 28 def upload_component(data) self.class.post('/project/updateAllComponents', body: { 'data' => data }.to_json) end |
#upload_third_lib_project(data) ⇒ Object
32 33 34 |
# File 'lib/yk_command/analyze/request.rb', line 32 def upload_third_lib_project(data) self.class.post('/project/updateThirdPartyDependency', body: { 'data' => data }.to_json) end |