Class: ApolloDeploySignalSdk::ValidateLinksResponse

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

Overview

Schema type: ValidateLinksResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(links:, total_links:, broken_links:, error_links:) ⇒ ValidateLinksResponse

Returns a new instance of ValidateLinksResponse.

Parameters:

  • links (Array<LinkResultItem>)

    , total_links [Integer], broken_links [Integer], error_links [Integer]



756
757
758
759
760
761
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 756

def initialize(links: , total_links: , broken_links: , error_links: )
  @links = links
  @total_links = total_links
  @broken_links = broken_links
  @error_links = error_links
end

Instance Attribute Details

Returns:

  • (Integer)


751
752
753
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 751

def broken_links
  @broken_links
end

Returns:

  • (Integer)


753
754
755
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 753

def error_links
  @error_links
end

Returns:



747
748
749
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 747

def links
  @links
end

Returns:

  • (Integer)


749
750
751
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 749

def total_links
  @total_links
end

Class Method Details

.from_json(attributes) ⇒ ValidateLinksResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



776
777
778
779
780
781
782
783
784
785
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 776

def self.from_json(attributes)
  return nil unless attributes.is_a?(Hash)

  new(
    links: attributes.key?("links") ? attributes["links"] : attributes[:links],
    total_links: attributes.key?("totalLinks") ? attributes["totalLinks"] : attributes[:total_links],
    broken_links: attributes.key?("brokenLinks") ? attributes["brokenLinks"] : attributes[:broken_links],
    error_links: attributes.key?("errorLinks") ? attributes["errorLinks"] : attributes[:error_links],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



764
765
766
767
768
769
770
771
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 764

def to_h
  {
    links: @links,
    total_links: @total_links,
    broken_links: @broken_links,
    error_links: @error_links,
  }.compact
end