Class: BillForward::UsageperiodsApi
- Inherits:
-
Object
- Object
- BillForward::UsageperiodsApi
- Defined in:
- lib/bf_ruby2/api/usageperiods_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_usage_period(subscription_id, period_id, opts = {}) ⇒ UsagePeriodPagedMetadata
Retrieve by subscription and period { "nickname" : "Retrieve by subscription and period","response" : "getUsagePeriodsForPeriod.html"}.
-
#get_usage_period_for_all(subscription_id, opts = {}) ⇒ UsagePeriodPagedMetadata
Retrieve by subscription { "nickname" : "Retrieve by subscription","response" : "getUsagePeriods.html"}.
-
#get_usage_period_for_all_with_http_info(subscription_id, opts = {}) ⇒ Array<(UsagePeriodPagedMetadata, Fixnum, Hash)>
Retrieve by subscription { "nickname" : "Retrieve by subscription","response" : "getUsagePeriods.html"}.
-
#get_usage_period_for_invoice(subscription_id, invoice_id, opts = {}) ⇒ UsagePeriodPagedMetadata
Retrieve by invoice) { "nickname" : "Retrieve by invoice","response" : "getUsagePeriodForInvoice.html"}.
-
#get_usage_period_for_invoice_with_http_info(subscription_id, invoice_id, opts = {}) ⇒ Array<(UsagePeriodPagedMetadata, Fixnum, Hash)>
Retrieve by invoice) { "nickname" : "Retrieve by invoice","response" : "getUsagePeriodForInvoice.html"}.
-
#get_usage_period_with_http_info(subscription_id, period_id, opts = {}) ⇒ Array<(UsagePeriodPagedMetadata, Fixnum, Hash)>
Retrieve by subscription and period { "nickname" : "Retrieve by subscription and period","response" : "getUsagePeriodsForPeriod.html"}.
-
#initialize(api_client = ApiClient.default) ⇒ UsageperiodsApi
constructor
A new instance of UsageperiodsApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ UsageperiodsApi
Returns a new instance of UsageperiodsApi.
30 31 32 |
# File 'lib/bf_ruby2/api/usageperiods_api.rb', line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
28 29 30 |
# File 'lib/bf_ruby2/api/usageperiods_api.rb', line 28 def api_client @api_client end |
Instance Method Details
#get_usage_period(subscription_id, period_id, opts = {}) ⇒ UsagePeriodPagedMetadata
Retrieve by subscription and period { "nickname" : "Retrieve by subscription and period","response" : "getUsagePeriodsForPeriod.html"}
45 46 47 48 |
# File 'lib/bf_ruby2/api/usageperiods_api.rb', line 45 def get_usage_period(subscription_id, period_id, opts = {}) data, _status_code, _headers = get_usage_period_with_http_info(subscription_id, period_id, opts) return data end |
#get_usage_period_for_all(subscription_id, opts = {}) ⇒ UsagePeriodPagedMetadata
Retrieve by subscription { "nickname" : "Retrieve by subscription","response" : "getUsagePeriods.html"}
123 124 125 126 |
# File 'lib/bf_ruby2/api/usageperiods_api.rb', line 123 def get_usage_period_for_all(subscription_id, opts = {}) data, _status_code, _headers = get_usage_period_for_all_with_http_info(subscription_id, opts) return data end |
#get_usage_period_for_all_with_http_info(subscription_id, opts = {}) ⇒ Array<(UsagePeriodPagedMetadata, Fixnum, Hash)>
Retrieve by subscription { "nickname" : "Retrieve by subscription","response" : "getUsagePeriods.html"}
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 182 183 184 185 186 |
# File 'lib/bf_ruby2/api/usageperiods_api.rb', line 138 def get_usage_period_for_all_with_http_info(subscription_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsageperiodsApi.get_usage_period_for_all ..." end # verify the required parameter 'subscription_id' is set fail ArgumentError, "Missing the required parameter 'subscription_id' when calling UsageperiodsApi.get_usage_period_for_all" if subscription_id.nil? if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order']) fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC' end # resource path local_var_path = "/usage-periods/{subscription-id}".sub('{format}','json').sub('{' + 'subscription-id' + '}', subscription_id.to_s) # query parameters query_params = {} query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil? query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json; charset=utf-8'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'UsagePeriodPagedMetadata') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageperiodsApi#get_usage_period_for_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_usage_period_for_invoice(subscription_id, invoice_id, opts = {}) ⇒ UsagePeriodPagedMetadata
Retrieve by invoice) { "nickname" : "Retrieve by invoice","response" : "getUsagePeriodForInvoice.html"}
199 200 201 202 |
# File 'lib/bf_ruby2/api/usageperiods_api.rb', line 199 def get_usage_period_for_invoice(subscription_id, invoice_id, opts = {}) data, _status_code, _headers = get_usage_period_for_invoice_with_http_info(subscription_id, invoice_id, opts) return data end |
#get_usage_period_for_invoice_with_http_info(subscription_id, invoice_id, opts = {}) ⇒ Array<(UsagePeriodPagedMetadata, Fixnum, Hash)>
Retrieve by invoice) { "nickname" : "Retrieve by invoice","response" : "getUsagePeriodForInvoice.html"}
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 263 264 265 |
# File 'lib/bf_ruby2/api/usageperiods_api.rb', line 215 def get_usage_period_for_invoice_with_http_info(subscription_id, invoice_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsageperiodsApi.get_usage_period_for_invoice ..." end # verify the required parameter 'subscription_id' is set fail ArgumentError, "Missing the required parameter 'subscription_id' when calling UsageperiodsApi.get_usage_period_for_invoice" if subscription_id.nil? # verify the required parameter 'invoice_id' is set fail ArgumentError, "Missing the required parameter 'invoice_id' when calling UsageperiodsApi.get_usage_period_for_invoice" if invoice_id.nil? if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order']) fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC' end # resource path local_var_path = "/usage-periods/{subscription-id}/invoice/{invoice-id}".sub('{format}','json').sub('{' + 'subscription-id' + '}', subscription_id.to_s).sub('{' + 'invoice-id' + '}', invoice_id.to_s) # query parameters query_params = {} query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil? query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json; charset=utf-8'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'UsagePeriodPagedMetadata') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageperiodsApi#get_usage_period_for_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_usage_period_with_http_info(subscription_id, period_id, opts = {}) ⇒ Array<(UsagePeriodPagedMetadata, Fixnum, Hash)>
Retrieve by subscription and period { "nickname" : "Retrieve by subscription and period","response" : "getUsagePeriodsForPeriod.html"}
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 |
# File 'lib/bf_ruby2/api/usageperiods_api.rb', line 61 def get_usage_period_with_http_info(subscription_id, period_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsageperiodsApi.get_usage_period ..." end # verify the required parameter 'subscription_id' is set fail ArgumentError, "Missing the required parameter 'subscription_id' when calling UsageperiodsApi.get_usage_period" if subscription_id.nil? # verify the required parameter 'period_id' is set fail ArgumentError, "Missing the required parameter 'period_id' when calling UsageperiodsApi.get_usage_period" if period_id.nil? if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order']) fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC' end # resource path local_var_path = "/usage-periods/{subscription-id}/{period-id}".sub('{format}','json').sub('{' + 'subscription-id' + '}', subscription_id.to_s).sub('{' + 'period-id' + '}', period_id.to_s) # query parameters query_params = {} query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil? query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json; charset=utf-8'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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 => 'UsagePeriodPagedMetadata') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageperiodsApi#get_usage_period\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |