Class: Latitude::API::Resources::BillingUsage

Inherits:
SingletonAPIResource show all
Defined in:
lib/latitude/api/resources/billing_usage.rb

Defined Under Namespace

Classes: Period

Constant Summary

Constants inherited from APIResource

APIResource::READ_ONLY_ATTRIBUTES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#id, #meta, #path_params, #raw_data, #type

Class Method Summary collapse

Methods inherited from SingletonAPIResource

instance_url, #resource_url

Methods inherited from APIResource

#==, #[], #[]=, #as_json, #attributes, #changed?, class_url, config_source, construct_from, #delete, execute_request, extract_path_params, #hash, id_prefix, #initialize, #inspect, instance_url, #method_missing, path_param_keys, #refresh, resource_path, resource_type, #resource_url, #respond_to_missing?, #save, #to_h, #unsaved_attributes, with_config, #write_attribute

Methods included from Attributes::ClassMethods

#attribute, #attribute_specs

Methods included from Attributes::InstanceMethods

#attribute_spec, #read_attribute, #wrap_attribute

Constructor Details

This class inherits a constructor from Latitude::API::APIResource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Latitude::API::APIResource

Instance Attribute Details

#amountInteger

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/latitude/api/resources/billing_usage.rb', line 20

class BillingUsage < SingletonAPIResource
    # @!attribute [r] start
    #   @return [Time]
    # @!attribute [r] end
    #   @return [Time]
  class Period < APIObject
    attribute :start, :time, read_only: true
    attribute :end, :time, read_only: true
  end

  attribute :project, Objects::Project
  attribute :period, Period
  attribute :available_credit_balance, :integer
  attribute :amount, :integer
  attribute :price, :integer
  attribute :products, :array
  attribute :threshold, :integer

  resource_type "billing_usage"
  resource_path "/billing/usage"

  class << self
    def retrieve(params = {}, opts = {})
      query = RequestParams.encode(params)
      parsed = execute_request(method: :get, path: resource_path, query: query, opts: opts)
      construct_from(parsed, opts: opts)
    end
  end
end

#available_credit_balanceInteger

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/latitude/api/resources/billing_usage.rb', line 20

class BillingUsage < SingletonAPIResource
    # @!attribute [r] start
    #   @return [Time]
    # @!attribute [r] end
    #   @return [Time]
  class Period < APIObject
    attribute :start, :time, read_only: true
    attribute :end, :time, read_only: true
  end

  attribute :project, Objects::Project
  attribute :period, Period
  attribute :available_credit_balance, :integer
  attribute :amount, :integer
  attribute :price, :integer
  attribute :products, :array
  attribute :threshold, :integer

  resource_type "billing_usage"
  resource_path "/billing/usage"

  class << self
    def retrieve(params = {}, opts = {})
      query = RequestParams.encode(params)
      parsed = execute_request(method: :get, path: resource_path, query: query, opts: opts)
      construct_from(parsed, opts: opts)
    end
  end
end

#periodPeriod

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/latitude/api/resources/billing_usage.rb', line 20

class BillingUsage < SingletonAPIResource
    # @!attribute [r] start
    #   @return [Time]
    # @!attribute [r] end
    #   @return [Time]
  class Period < APIObject
    attribute :start, :time, read_only: true
    attribute :end, :time, read_only: true
  end

  attribute :project, Objects::Project
  attribute :period, Period
  attribute :available_credit_balance, :integer
  attribute :amount, :integer
  attribute :price, :integer
  attribute :products, :array
  attribute :threshold, :integer

  resource_type "billing_usage"
  resource_path "/billing/usage"

  class << self
    def retrieve(params = {}, opts = {})
      query = RequestParams.encode(params)
      parsed = execute_request(method: :get, path: resource_path, query: query, opts: opts)
      construct_from(parsed, opts: opts)
    end
  end
end

#priceInteger

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/latitude/api/resources/billing_usage.rb', line 20

class BillingUsage < SingletonAPIResource
    # @!attribute [r] start
    #   @return [Time]
    # @!attribute [r] end
    #   @return [Time]
  class Period < APIObject
    attribute :start, :time, read_only: true
    attribute :end, :time, read_only: true
  end

  attribute :project, Objects::Project
  attribute :period, Period
  attribute :available_credit_balance, :integer
  attribute :amount, :integer
  attribute :price, :integer
  attribute :products, :array
  attribute :threshold, :integer

  resource_type "billing_usage"
  resource_path "/billing/usage"

  class << self
    def retrieve(params = {}, opts = {})
      query = RequestParams.encode(params)
      parsed = execute_request(method: :get, path: resource_path, query: query, opts: opts)
      construct_from(parsed, opts: opts)
    end
  end
end

#productsArray

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/latitude/api/resources/billing_usage.rb', line 20

class BillingUsage < SingletonAPIResource
    # @!attribute [r] start
    #   @return [Time]
    # @!attribute [r] end
    #   @return [Time]
  class Period < APIObject
    attribute :start, :time, read_only: true
    attribute :end, :time, read_only: true
  end

  attribute :project, Objects::Project
  attribute :period, Period
  attribute :available_credit_balance, :integer
  attribute :amount, :integer
  attribute :price, :integer
  attribute :products, :array
  attribute :threshold, :integer

  resource_type "billing_usage"
  resource_path "/billing/usage"

  class << self
    def retrieve(params = {}, opts = {})
      query = RequestParams.encode(params)
      parsed = execute_request(method: :get, path: resource_path, query: query, opts: opts)
      construct_from(parsed, opts: opts)
    end
  end
end

#projectLatitude::API::Objects::Project

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/latitude/api/resources/billing_usage.rb', line 20

class BillingUsage < SingletonAPIResource
    # @!attribute [r] start
    #   @return [Time]
    # @!attribute [r] end
    #   @return [Time]
  class Period < APIObject
    attribute :start, :time, read_only: true
    attribute :end, :time, read_only: true
  end

  attribute :project, Objects::Project
  attribute :period, Period
  attribute :available_credit_balance, :integer
  attribute :amount, :integer
  attribute :price, :integer
  attribute :products, :array
  attribute :threshold, :integer

  resource_type "billing_usage"
  resource_path "/billing/usage"

  class << self
    def retrieve(params = {}, opts = {})
      query = RequestParams.encode(params)
      parsed = execute_request(method: :get, path: resource_path, query: query, opts: opts)
      construct_from(parsed, opts: opts)
    end
  end
end

#thresholdInteger

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/latitude/api/resources/billing_usage.rb', line 20

class BillingUsage < SingletonAPIResource
    # @!attribute [r] start
    #   @return [Time]
    # @!attribute [r] end
    #   @return [Time]
  class Period < APIObject
    attribute :start, :time, read_only: true
    attribute :end, :time, read_only: true
  end

  attribute :project, Objects::Project
  attribute :period, Period
  attribute :available_credit_balance, :integer
  attribute :amount, :integer
  attribute :price, :integer
  attribute :products, :array
  attribute :threshold, :integer

  resource_type "billing_usage"
  resource_path "/billing/usage"

  class << self
    def retrieve(params = {}, opts = {})
      query = RequestParams.encode(params)
      parsed = execute_request(method: :get, path: resource_path, query: query, opts: opts)
      construct_from(parsed, opts: opts)
    end
  end
end

Class Method Details

.retrieve(params = {}, opts = {}) ⇒ Object



42
43
44
45
46
# File 'lib/latitude/api/resources/billing_usage.rb', line 42

def retrieve(params = {}, opts = {})
  query = RequestParams.encode(params)
  parsed = execute_request(method: :get, path: resource_path, query: query, opts: opts)
  construct_from(parsed, opts: opts)
end