Class: ApolloDeploySignalSdkRails::LinkResultItem
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::LinkResultItem
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: LinkResultItem
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ LinkResultItem
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(url:, status:, status_code: nil, error: nil) ⇒ LinkResultItem
constructor
A new instance of LinkResultItem.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(url:, status:, status_code: nil, error: nil) ⇒ LinkResultItem
Returns a new instance of LinkResultItem.
712 713 714 715 716 717 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 712 def initialize(url: , status: , status_code: nil, error: nil) @url = url @status = status @status_code = status_code @error = error end |
Instance Attribute Details
#error ⇒ String?
709 710 711 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 709 def error @error end |
#status ⇒ String
705 706 707 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 705 def status @status end |
#status_code ⇒ Integer?
707 708 709 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 707 def status_code @status_code end |
#url ⇒ String
703 704 705 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 703 def url @url end |
Class Method Details
.from_json(attributes) ⇒ LinkResultItem
Create an instance from a parsed JSON hash.
732 733 734 735 736 737 738 739 740 741 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 732 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( url: attributes.key?("url") ? attributes["url"] : attributes[:url], status: attributes.key?("status") ? attributes["status"] : attributes[:status], status_code: attributes.key?("statusCode") ? attributes["statusCode"] : attributes[:status_code], error: attributes.key?("error") ? attributes["error"] : attributes[:error], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
720 721 722 723 724 725 726 727 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 720 def to_h { url: @url, status: @status, status_code: @status_code, error: @error, }.compact end |