Class: FdxV660Api::OperationEntity
- Defined in:
- lib/fdx_v660_api/models/operation_entity.rb
Overview
Definition of a supported API for the /capability response object
Instance Attribute Summary collapse
-
#also_supported ⇒ Array[FdxResourceOperationId]
Additional FDX API endpoints supported at this API, e.g.
-
#availability ⇒ AvailabilityEntity1
Whether and how this API is currently supported.
-
#content_types ⇒ Array[ContentTypes]
HTTP response media types supported at this endpoint.
-
#cut_off_time ⇒ DateTime
Cut off time for same-day execution of activity request submitted to this API.
-
#fdx_versions ⇒ Array[FdxVersion]
FDX schema versions supported at this endpoint.
-
#id ⇒ FdxResourceOperationId1
Operation ID (e.g. name) of this API.
-
#link ⇒ HateoasLink4
General HATEOAS link for this API, specifying supported action (GET, POST, etc) and contentTypes (application/json, image/png, etc), but without any path parameter values.
-
#version ⇒ String
Data provider's implementation version number for this operation, which is unrelated to the FDX API version.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(id: SKIP, availability: SKIP, also_supported: SKIP, version: SKIP, fdx_versions: SKIP, content_types: SKIP, cut_off_time: SKIP, link: SKIP, additional_properties: nil) ⇒ OperationEntity
constructor
A new instance of OperationEntity.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_cut_off_time ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(id: SKIP, availability: SKIP, also_supported: SKIP, version: SKIP, fdx_versions: SKIP, content_types: SKIP, cut_off_time: SKIP, link: SKIP, additional_properties: nil) ⇒ OperationEntity
Returns a new instance of OperationEntity.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 84 def initialize(id: SKIP, availability: SKIP, also_supported: SKIP, version: SKIP, fdx_versions: SKIP, content_types: SKIP, cut_off_time: SKIP, link: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id unless id == SKIP @availability = availability unless availability == SKIP @also_supported = also_supported unless also_supported == SKIP @version = version unless version == SKIP @fdx_versions = fdx_versions unless fdx_versions == SKIP @content_types = content_types unless content_types == SKIP @cut_off_time = cut_off_time unless cut_off_time == SKIP @link = link unless link == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#also_supported ⇒ Array[FdxResourceOperationId]
Additional FDX API endpoints supported at this API, e.g. Transactions within Accounts, or TxImages within Transactions
24 25 26 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 24 def also_supported @also_supported end |
#availability ⇒ AvailabilityEntity1
Whether and how this API is currently supported
19 20 21 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 19 def availability @availability end |
#content_types ⇒ Array[ContentTypes]
HTTP response media types supported at this endpoint
37 38 39 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 37 def content_types @content_types end |
#cut_off_time ⇒ DateTime
Cut off time for same-day execution of activity request submitted to this API. Alternatively, the as-of time when EOD account balances are typically set
43 44 45 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 43 def cut_off_time @cut_off_time end |
#fdx_versions ⇒ Array[FdxVersion]
FDX schema versions supported at this endpoint
33 34 35 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 33 def fdx_versions @fdx_versions end |
#id ⇒ FdxResourceOperationId1
Operation ID (e.g. name) of this API
15 16 17 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 15 def id @id end |
#link ⇒ HateoasLink4
General HATEOAS link for this API, specifying supported action (GET, POST, etc) and contentTypes (application/json, image/png, etc), but without any path parameter values
49 50 51 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 49 def link @link end |
#version ⇒ String
Data provider's implementation version number for this operation, which is unrelated to the FDX API version
29 30 31 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 29 def version @version end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 102 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP availability = AvailabilityEntity1.from_hash(hash['availability']) if hash['availability'] also_supported = hash.key?('alsoSupported') ? hash['alsoSupported'] : SKIP version = hash.key?('version') ? hash['version'] : SKIP fdx_versions = hash.key?('fdxVersions') ? hash['fdxVersions'] : SKIP content_types = hash.key?('contentTypes') ? hash['contentTypes'] : SKIP cut_off_time = if hash.key?('cutOffTime') (DateTimeHelper.from_rfc3339(hash['cutOffTime']) if hash['cutOffTime']) else SKIP end link = HateoasLink4.from_hash(hash['link']) if hash['link'] # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. OperationEntity.new(id: id, availability: availability, also_supported: also_supported, version: version, fdx_versions: fdx_versions, content_types: content_types, cut_off_time: cut_off_time, link: link, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 52 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['availability'] = 'availability' @_hash['also_supported'] = 'alsoSupported' @_hash['version'] = 'version' @_hash['fdx_versions'] = 'fdxVersions' @_hash['content_types'] = 'contentTypes' @_hash['cut_off_time'] = 'cutOffTime' @_hash['link'] = 'link' @_hash end |
.nullables ⇒ Object
An array for nullable fields
80 81 82 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 80 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 66 def self.optionals %w[ id availability also_supported version fdx_versions content_types cut_off_time link ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
152 153 154 155 156 157 158 159 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 152 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, availability: #{@availability.inspect}, also_supported:"\ " #{@also_supported.inspect}, version: #{@version.inspect}, fdx_versions:"\ " #{@fdx_versions.inspect}, content_types: #{@content_types.inspect}, cut_off_time:"\ " #{@cut_off_time.inspect}, link: #{@link.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_cut_off_time ⇒ Object
138 139 140 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 138 def to_custom_cut_off_time DateTimeHelper.to_rfc3339(cut_off_time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
143 144 145 146 147 148 149 |
# File 'lib/fdx_v660_api/models/operation_entity.rb', line 143 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, availability: #{@availability}, also_supported:"\ " #{@also_supported}, version: #{@version}, fdx_versions: #{@fdx_versions}, content_types:"\ " #{@content_types}, cut_off_time: #{@cut_off_time}, link: #{@link}, additional_properties:"\ " #{@additional_properties}>" end |