Class: OCI::MarketplacePublisher::Models::SaaSPricingPlan
- Inherits:
-
PricingPlan
- Object
- PricingPlan
- OCI::MarketplacePublisher::Models::SaaSPricingPlan
- Defined in:
- lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb
Overview
SaaS pricing plan.
Constant Summary collapse
- BILLING_FREQUENCY_ENUM =
[ BILLING_FREQUENCY_MONTHLY = 'MONTHLY'.freeze, BILLING_FREQUENCY_QUARTERLY = 'QUARTERLY'.freeze, BILLING_FREQUENCY_YEARLY = 'YEARLY'.freeze, BILLING_FREQUENCY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Constants inherited from PricingPlan
Instance Attribute Summary collapse
-
#billing_frequency ⇒ String
[Required] The plan billing frequency.
-
#extended_metadata ⇒ Hash<String, String>
Additional metadata key/value pairs for the saas pricing.
-
#name ⇒ String
[Required] The plan name.
-
#plan_description ⇒ String
[Required] The plan description.
Attributes inherited from PricingPlan
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ SaaSPricingPlan
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Methods inherited from PricingPlan
Constructor Details
#initialize(attributes = {}) ⇒ SaaSPricingPlan
Initializes the object
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 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 77 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['planType'] = 'FIXED' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.name = attributes[:'name'] if attributes[:'name'] self.plan_description = attributes[:'planDescription'] if attributes[:'planDescription'] raise 'You cannot provide both :planDescription and :plan_description' if attributes.key?(:'planDescription') && attributes.key?(:'plan_description') self.plan_description = attributes[:'plan_description'] if attributes[:'plan_description'] self.billing_frequency = attributes[:'billingFrequency'] if attributes[:'billingFrequency'] raise 'You cannot provide both :billingFrequency and :billing_frequency' if attributes.key?(:'billingFrequency') && attributes.key?(:'billing_frequency') self.billing_frequency = attributes[:'billing_frequency'] if attributes[:'billing_frequency'] self. = attributes[:'extendedMetadata'] if attributes[:'extendedMetadata'] raise 'You cannot provide both :extendedMetadata and :extended_metadata' if attributes.key?(:'extendedMetadata') && attributes.key?(:'extended_metadata') self. = attributes[:'extended_metadata'] if attributes[:'extended_metadata'] end |
Instance Attribute Details
#billing_frequency ⇒ String
[Required] The plan billing frequency.
31 32 33 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 31 def billing_frequency @billing_frequency end |
#extended_metadata ⇒ Hash<String, String>
Additional metadata key/value pairs for the saas pricing.
36 37 38 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 36 def @extended_metadata end |
#name ⇒ String
[Required] The plan name.
23 24 25 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 23 def name @name end |
#plan_description ⇒ String
[Required] The plan description.
27 28 29 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 27 def plan_description @plan_description end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 39 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'plan_type': :'planType', 'rates': :'rates', 'name': :'name', 'plan_description': :'planDescription', 'billing_frequency': :'billingFrequency', 'extended_metadata': :'extendedMetadata' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 53 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'plan_type': :'String', 'rates': :'Array<OCI::MarketplacePublisher::Models::PricingRate>', 'name': :'String', 'plan_description': :'String', 'billing_frequency': :'String', 'extended_metadata': :'Hash<String, String>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 128 def ==(other) return true if equal?(other) self.class == other.class && plan_type == other.plan_type && rates == other.rates && name == other.name && plan_description == other.plan_description && billing_frequency == other.billing_frequency && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 163 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
143 144 145 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 143 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
152 153 154 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 152 def hash [plan_type, rates, name, plan_description, billing_frequency, ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
196 197 198 199 200 201 202 203 204 205 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 196 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
190 191 192 |
# File 'lib/oci/marketplace_publisher/models/saa_s_pricing_plan.rb', line 190 def to_s to_hash.to_s end |