Class: Aws::S3::Plugins::ARN Private

Inherits:
Seahorse::Client::Plugin
  • Object
show all
Defined in:
lib/aws-sdk-s3/plugins/arn.rb

Overview

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.

When an accesspoint ARN is provided for :bucket in S3 operations, this plugin resolves the request endpoint from the ARN when possible.

Defined Under Namespace

Classes: Handler

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.resolve_arn!(member_value, region, use_arn_region) ⇒ 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.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/aws-sdk-s3/plugins/arn.rb', line 97

def resolve_arn!(member_value, region, use_arn_region)
  if Aws::ARNParser.arn?(member_value)
    arn = Aws::ARNParser.parse(member_value)
    if arn.resource.start_with?('accesspoint')
      s3_arn = Aws::S3::AccessPointARN.new(arn.to_h)
    elsif arn.resource.start_with?('outpost')
      s3_arn = Aws::S3::OutpostAccessPointARN.new(arn.to_h)
    else
      raise ArgumentError,
            'Only Access Point and Outpost Access Point type ARNs '\
            'are currently supported.'
    end
    s3_arn.validate_arn!
    validate_region_config!(s3_arn, region, use_arn_region)
    region = s3_arn.region if use_arn_region
    [region, s3_arn]
  else
    [region]
  end
end

.resolve_url!(url, arn, region, dualstack = false) ⇒ 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.



119
120
121
122
123
# File 'lib/aws-sdk-s3/plugins/arn.rb', line 119

def resolve_url!(url, arn, region, dualstack = false)
  url.host = arn.host_url(region, dualstack)
  url.path = url_path(url.path, arn)
  url
end

Instance Method Details

#add_handlers(handlers, _config) ⇒ 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.



25
26
27
# File 'lib/aws-sdk-s3/plugins/arn.rb', line 25

def add_handlers(handlers, _config)
  handlers.add(Handler)
end