Class: Vapi::AnalyticsOperation
- Inherits:
-
Object
- Object
- Vapi::AnalyticsOperation
- Defined in:
- lib/vapi_server_sdk/types/analytics_operation.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#alias_ ⇒ String
readonly
This is the alias for column name returned.
-
#column ⇒ Vapi::AnalyticsOperationColumn
readonly
This is the columns you want to perform the aggregation operation on.
-
#operation ⇒ Vapi::AnalyticsOperationOperation
readonly
This is the aggregation operation you want to perform.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::AnalyticsOperation
Deserialize a JSON object to an instance of AnalyticsOperation.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(operation:, column:, alias_: OMIT, additional_properties: nil) ⇒ Vapi::AnalyticsOperation constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AnalyticsOperation to a JSON object.
Constructor Details
#initialize(operation:, column:, alias_: OMIT, additional_properties: nil) ⇒ Vapi::AnalyticsOperation
29 30 31 32 33 34 35 36 37 |
# File 'lib/vapi_server_sdk/types/analytics_operation.rb', line 29 def initialize(operation:, column:, alias_: OMIT, additional_properties: nil) @operation = operation @column = column @alias_ = alias_ if alias_ != OMIT @additional_properties = additional_properties @_field_set = { "operation": operation, "column": column, "alias": alias_ }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/vapi_server_sdk/types/analytics_operation.rb', line 17 def additional_properties @additional_properties end |
#alias_ ⇒ String (readonly)
Returns This is the alias for column name returned. Defaults to ‘$#operation$#column`.
15 16 17 |
# File 'lib/vapi_server_sdk/types/analytics_operation.rb', line 15 def alias_ @alias_ end |
#column ⇒ Vapi::AnalyticsOperationColumn (readonly)
Returns This is the columns you want to perform the aggregation operation on.
13 14 15 |
# File 'lib/vapi_server_sdk/types/analytics_operation.rb', line 13 def column @column end |
#operation ⇒ Vapi::AnalyticsOperationOperation (readonly)
Returns This is the aggregation operation you want to perform.
11 12 13 |
# File 'lib/vapi_server_sdk/types/analytics_operation.rb', line 11 def operation @operation end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::AnalyticsOperation
Deserialize a JSON object to an instance of AnalyticsOperation
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/vapi_server_sdk/types/analytics_operation.rb', line 43 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) operation = parsed_json["operation"] column = parsed_json["column"] alias_ = parsed_json["alias"] new( operation: operation, column: column, alias_: alias_, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
70 71 72 73 74 |
# File 'lib/vapi_server_sdk/types/analytics_operation.rb', line 70 def self.validate_raw(obj:) obj.operation.is_a?(Vapi::AnalyticsOperationOperation) != false || raise("Passed value for field obj.operation is not the expected type, validation failed.") obj.column.is_a?(Vapi::AnalyticsOperationColumn) != false || raise("Passed value for field obj.column is not the expected type, validation failed.") obj.alias_&.is_a?(String) != false || raise("Passed value for field obj.alias_ is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of AnalyticsOperation to a JSON object
60 61 62 |
# File 'lib/vapi_server_sdk/types/analytics_operation.rb', line 60 def to_json(*_args) @_field_set&.to_json end |