Class: ApolloDeploySignalSdkRails::LinkResultItem

Inherits:
Object
  • Object
show all
Defined in:
lib/apollo_deploy_signal_sdk_rails/types.rb

Overview

Schema type: LinkResultItem

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url:, status:, status_code: nil, error: nil) ⇒ LinkResultItem

Returns a new instance of LinkResultItem.

Parameters:

  • url (String)

    , status [String], status_code [Integer, nil], error [String, nil]



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

#errorString?

Returns:

  • (String, nil)


709
710
711
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 709

def error
  @error
end

#statusString

Returns:

  • (String)


705
706
707
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 705

def status
  @status
end

#status_codeInteger?

Returns:

  • (Integer, nil)


707
708
709
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 707

def status_code
  @status_code
end

#urlString

Returns:

  • (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.

Parameters:

  • attributes (Hash)

Returns:



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_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    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