Class: ApiReference::NewDimensionalPriceGroup

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/api_reference/models/new_dimensional_price_group.rb

Overview

NewDimensionalPriceGroup Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(name:, dimensions:, billable_metric_id:, metadata: SKIP, external_dimensional_price_group_id: SKIP) ⇒ NewDimensionalPriceGroup

Returns a new instance of NewDimensionalPriceGroup.



66
67
68
69
70
71
72
73
74
75
76
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 66

def initialize(name:, dimensions:, billable_metric_id:, metadata: SKIP,
               external_dimensional_price_group_id: SKIP)
  @metadata =  unless  == SKIP
  @name = name
  unless external_dimensional_price_group_id == SKIP
    @external_dimensional_price_group_id =
      external_dimensional_price_group_id
  end
  @dimensions = dimensions
  @billable_metric_id = billable_metric_id
end

Instance Attribute Details

#billable_metric_idString

The set of keys (in order) used to disambiguate prices in the group.

Returns:

  • (String)


36
37
38
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 36

def billable_metric_id
  @billable_metric_id
end

#dimensionsArray[String]

The set of keys (in order) used to disambiguate prices in the group.

Returns:

  • (Array[String])


32
33
34
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 32

def dimensions
  @dimensions
end

#external_dimensional_price_group_idString

User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

Returns:

  • (String)


28
29
30
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 28

def external_dimensional_price_group_id
  @external_dimensional_price_group_id
end

#metadataHash[String, String]

User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

Returns:

  • (Hash[String, String])


16
17
18
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 16

def 
  @metadata
end

#nameString

User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

Returns:

  • (String)


22
23
24
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 22

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 79

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : nil
  dimensions = hash.key?('dimensions') ? hash['dimensions'] : nil
  billable_metric_id =
    hash.key?('billable_metric_id') ? hash['billable_metric_id'] : nil
   = hash.key?('metadata') ? hash['metadata'] : SKIP
  external_dimensional_price_group_id =
    hash.key?('external_dimensional_price_group_id') ? hash['external_dimensional_price_group_id'] : SKIP

  # Create object from extracted values.
  NewDimensionalPriceGroup.new(name: name,
                               dimensions: dimensions,
                               billable_metric_id: billable_metric_id,
                               metadata: ,
                               external_dimensional_price_group_id: external_dimensional_price_group_id)
end

.namesObject

A mapping from model property names to API property names.



39
40
41
42
43
44
45
46
47
48
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 39

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['metadata'] = 'metadata'
  @_hash['name'] = 'name'
  @_hash['external_dimensional_price_group_id'] =
    'external_dimensional_price_group_id'
  @_hash['dimensions'] = 'dimensions'
  @_hash['billable_metric_id'] = 'billable_metric_id'
  @_hash
end

.nullablesObject

An array for nullable fields



59
60
61
62
63
64
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 59

def self.nullables
  %w[
    metadata
    external_dimensional_price_group_id
  ]
end

.optionalsObject

An array for optional fields



51
52
53
54
55
56
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 51

def self.optionals
  %w[
    metadata
    external_dimensional_price_group_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



108
109
110
111
112
113
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 108

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} metadata: #{@metadata.inspect}, name: #{@name.inspect},"\
  " external_dimensional_price_group_id: #{@external_dimensional_price_group_id.inspect},"\
  " dimensions: #{@dimensions.inspect}, billable_metric_id: #{@billable_metric_id.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



100
101
102
103
104
105
# File 'lib/api_reference/models/new_dimensional_price_group.rb', line 100

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} metadata: #{@metadata}, name: #{@name},"\
  " external_dimensional_price_group_id: #{@external_dimensional_price_group_id}, dimensions:"\
  " #{@dimensions}, billable_metric_id: #{@billable_metric_id}>"
end