class Aws::Partitions::Service
Attributes
@return [String] The name of this service. The name is the module
name as used by the AWS SDK for Ruby.
@return [String] The partition name, e.g “aws”, “aws-cn”, “aws-us-gov”.
@return [String,nil] The global patition endpoint for this service.
May be `nil`.
@return [Set<String>] The regions this service is available in.
Regions are scoped to the partition.
Public Class Methods
@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
@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
# File lib/aws-sdk-core/partitions/service.rb, line 67 def partition_region(service) service['partitionEndpoint'] end
# 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
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