class Aws::Partitions::Service

Attributes

name[R]

@return [String] The name of this service. The name is the module

name as used by the AWS SDK for Ruby.
partition_name[R]

@return [String] The partition name, e.g “aws”, “aws-cn”, “aws-us-gov”.

partition_region[R]

@return [String,nil] The global patition endpoint for this service.

May be `nil`.
regions[R]

@return [Set<String>] The regions this service is available in.

Regions are scoped to the partition.

Public Class Methods

build(service_name, service, partition) click to toggle source

@api private

# File lib/aws-sdk-core/partitions/service.rb, line 50
def build(service_name, service, partition)
  Service.new(
    name: service_name,
    partition_name: partition['partition'],
    regions: regions(service, partition),
    regionalized: service['isRegionalized'] != false,
    partition_region: partition_region(service)
  )
end
new(options = {}) click to toggle source

@option options [required, String] :name @option options [required, String] :partition_name @option options [required, Set<String>] :region_name @option options [required, Boolean] :regionalized @option options [String] :partition_region @api private

# File lib/aws-sdk-core/partitions/service.rb, line 13
def initialize(options = {})
  @name = options[:name]
  @partition_name = options[:partition_name]
  @regions = options[:regions]
  @regionalized = options[:regionalized]
  @partition_region = options[:partition_region]
end

Private Class Methods

partition_region(service) click to toggle source
# File lib/aws-sdk-core/partitions/service.rb, line 67
def partition_region(service)
  service['partitionEndpoint']
end
regions(service, partition) click to toggle source
# File lib/aws-sdk-core/partitions/service.rb, line 62
def regions(service, partition)
  names = Set.new(partition['regions'].keys & service['endpoints'].keys)
  names - ["#{partition['partition']}-global"]
end

Public Instance Methods

regionalized?() click to toggle source

Returns `false` if the service operates with a single global endpoint for the current partition, returns `true` if the service is available in mutliple regions.

Some services have both a partition endpoint and regional endpoints.

@return [Boolean]

# File lib/aws-sdk-core/partitions/service.rb, line 43
def regionalized?
  @regionalized
end