Class: Aws::Plugins::ChecksumAlgorithm::OptionHandler Private

Inherits:
Seahorse::Client::Handler show all
Defined in:
lib/aws-sdk-core/plugins/checksum_algorithm.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Handler

#handler

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Handler

#initialize, #inspect

Constructor Details

This class inherits a constructor from Seahorse::Client::Handler

Instance Method Details

#call(context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/aws-sdk-core/plugins/checksum_algorithm.rb', line 88

def call(context)
  context[:http_checksum] ||= {}

  # validate request configuration
  if (request_input = ChecksumAlgorithm.request_algorithm_selection(context))
    unless CLIENT_ALGORITHMS.include? request_input
      if (request_input == 'CRC32C')
        raise ArgumentError, "CRC32C requires crt support - install the aws-crt gem for support."
      else
        raise ArgumentError, "#{request_input} is not a supported checksum algorithm."
      end
    end
  end

# validate response configuration
  if (ChecksumAlgorithm.request_validation_mode(context))
    # Compute an ordered list as the union between priority supported and the
    # operation's modeled response algorithms.
    validation_list = CHECKSUM_ALGORITHM_PRIORITIES &
      ChecksumAlgorithm.operation_response_algorithms(context)
    context[:http_checksum][:validation_list] = validation_list
  end

  @handler.call(context)
end