class Aws::S3::Errors::PermanentRedirect
and bucket.
Hijack PermanentRedirect dynamic error to also include endpoint
def initialize(context, message, _data = Aws::EmptyStructure.new)
-
data
(Aws::S3::Types::PermanentRedirect
) -- -
message
(String
) -- -
context
(Seahorse::Client::RequestContext
) --
def initialize(context, message, _data = Aws::EmptyStructure.new) data = Aws::S3::Types::PermanentRedirect.new(message: message) body = context.http_response.body_contents if (endpoint = body.match(/<Endpoint>(.+?)<\/Endpoint>/)) data.endpoint = endpoint[1] end if (bucket = body.match(/<Bucket>(.+?)<\/Bucket>/)) data.bucket = bucket[1] end data.region = context.http_response.headers['x-amz-bucket-region'] super(context, message, data) end