Class: Vantage::CostsApi
- Inherits:
-
Object
- Object
- Vantage::CostsApi
- Defined in:
- lib/vantage-client/api/costs_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_costs(report_id, opts = {}) ⇒ Costs
Return available Costs for the specified Cost Report and optional time period.
-
#get_costs_with_http_info(report_id, opts = {}) ⇒ Array<(Costs, Fixnum, Hash)>
Return available Costs for the specified Cost Report and optional time period.
-
#get_report(report_id, opts = {}) ⇒ Report
Return a Cost Report.
-
#get_report_with_http_info(report_id, opts = {}) ⇒ Array<(Report, Fixnum, Hash)>
Return a Cost Report.
-
#get_reports(opts = {}) ⇒ Reports
Return all Cost Reports.
-
#get_reports_with_http_info(opts = {}) ⇒ Array<(Reports, Fixnum, Hash)>
Return all Cost Reports.
-
#initialize(api_client = ApiClient.default) ⇒ CostsApi
constructor
A new instance of CostsApi.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/vantage-client/api/costs_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_costs(report_id, opts = {}) ⇒ Costs
Return available Costs for the specified Cost Report and optional time period. If no time period is specified it will return all available costs for the report.
30 31 32 33 |
# File 'lib/vantage-client/api/costs_api.rb', line 30 def get_costs(report_id, opts = {}) data, _status_code, _headers = get_costs_with_http_info(report_id, opts) data end |
#get_costs_with_http_info(report_id, opts = {}) ⇒ Array<(Costs, Fixnum, Hash)>
Return available Costs for the specified Cost Report and optional time period. If no time period is specified it will return all available costs for the report.
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 |
# File 'lib/vantage-client/api/costs_api.rb', line 43 def get_costs_with_http_info(report_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CostsApi.get_costs ...' end # verify the required parameter 'report_id' is set if @api_client.config.client_side_validation && report_id.nil? fail ArgumentError, "Missing the required parameter 'report_id' when calling CostsApi.get_costs" end # resource path local_var_path = '/v1/reports/{report_id}/costs'.sub('{' + 'report_id' + '}', report_id.to_s) # query parameters query_params = {} query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Costs') if @api_client.config.debugging @api_client.config.logger.debug "API called: CostsApi#get_costs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_report(report_id, opts = {}) ⇒ Report
Return a Cost Report.
88 89 90 91 |
# File 'lib/vantage-client/api/costs_api.rb', line 88 def get_report(report_id, opts = {}) data, _status_code, _headers = get_report_with_http_info(report_id, opts) data end |
#get_report_with_http_info(report_id, opts = {}) ⇒ Array<(Report, Fixnum, Hash)>
Return a Cost Report.
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 |
# File 'lib/vantage-client/api/costs_api.rb', line 97 def get_report_with_http_info(report_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CostsApi.get_report ...' end # verify the required parameter 'report_id' is set if @api_client.config.client_side_validation && report_id.nil? fail ArgumentError, "Missing the required parameter 'report_id' when calling CostsApi.get_report" end # resource path local_var_path = '/v1/reports/{report_id}'.sub('{' + 'report_id' + '}', report_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Report') if @api_client.config.debugging @api_client.config.logger.debug "API called: CostsApi#get_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_reports(opts = {}) ⇒ Reports
Return all Cost Reports.
139 140 141 142 |
# File 'lib/vantage-client/api/costs_api.rb', line 139 def get_reports(opts = {}) data, _status_code, _headers = get_reports_with_http_info(opts) data end |
#get_reports_with_http_info(opts = {}) ⇒ Array<(Reports, Fixnum, Hash)>
Return all Cost Reports.
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 |
# File 'lib/vantage-client/api/costs_api.rb', line 149 def get_reports_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CostsApi.get_reports ...' end # resource path local_var_path = '/v1/reports' # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Reports') if @api_client.config.debugging @api_client.config.logger.debug "API called: CostsApi#get_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |