Class: ApolloDeploySignalSdkRails::AttachmentRequest
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::AttachmentRequest
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: AttachmentRequest
Instance Attribute Summary collapse
- #content ⇒ String
- #content_id ⇒ String?
- #content_type ⇒ String
- #disposition ⇒ String
- #filename ⇒ String
Class Method Summary collapse
-
.from_json(attributes) ⇒ AttachmentRequest
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(filename:, content:, content_type:, disposition: nil, content_id: nil) ⇒ AttachmentRequest
constructor
A new instance of AttachmentRequest.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(filename:, content:, content_type:, disposition: nil, content_id: nil) ⇒ AttachmentRequest
Returns a new instance of AttachmentRequest.
18 19 20 21 22 23 24 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 18 def initialize(filename: , content: , content_type: , disposition: nil, content_id: nil) @filename = filename @content = content @content_type = content_type @disposition = disposition @content_id = content_id end |
Instance Attribute Details
#content ⇒ String
9 10 11 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 9 def content @content end |
#content_id ⇒ String?
15 16 17 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 15 def content_id @content_id end |
#content_type ⇒ String
11 12 13 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 11 def content_type @content_type end |
#disposition ⇒ String
13 14 15 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 13 def disposition @disposition end |
#filename ⇒ String
7 8 9 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 7 def filename @filename end |
Class Method Details
.from_json(attributes) ⇒ AttachmentRequest
Create an instance from a parsed JSON hash.
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 40 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( filename: attributes.key?("filename") ? attributes["filename"] : attributes[:filename], content: attributes.key?("content") ? attributes["content"] : attributes[:content], content_type: attributes.key?("contentType") ? attributes["contentType"] : attributes[:content_type], disposition: attributes.key?("disposition") ? attributes["disposition"] : attributes[:disposition], content_id: attributes.key?("contentId") ? attributes["contentId"] : attributes[:content_id], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
27 28 29 30 31 32 33 34 35 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 27 def to_h { filename: @filename, content: @content, content_type: @content_type, disposition: @disposition, content_id: @content_id, }.compact end |