Class: Aws::Partitions::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-partitions/service.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Service

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.

Returns a new instance of Service.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :name (required, String)
  • :partition_name (required, String)
  • :region_name (required, Set<String>)
  • :regionalized (required, Boolean)
  • :partition_region (String)


15
16
17
18
19
20
21
22
23
# File 'lib/aws-partitions/service.rb', line 15

def initialize(options = {})
  @name = options[:name]
  @partition_name = options[:partition_name]
  @regions = options[:regions]
  @fips_regions = options[:fips_regions]
  @dualstack_regions = options[:dualstack_regions]
  @regionalized = options[:regionalized]
  @partition_region = options[:partition_region]
end

Instance Attribute Details

#dualstack_regionsSet<String> (readonly)

Returns The Dualstack compatible regions this service is available in. Regions are scoped to the partition.

Returns:

  • (Set<String>)

    The Dualstack compatible regions this service is available in. Regions are scoped to the partition.



42
43
44
# File 'lib/aws-partitions/service.rb', line 42

def dualstack_regions
  @dualstack_regions
end

#fips_regionsSet<String> (readonly)

Returns The FIPS compatible regions this service is available in. Regions are scoped to the partition.

Returns:

  • (Set<String>)

    The FIPS compatible regions this service is available in. Regions are scoped to the partition.



38
39
40
# File 'lib/aws-partitions/service.rb', line 38

def fips_regions
  @fips_regions
end

#nameString (readonly)

Returns The name of this service. The name is the module name as used by the AWS SDK for Ruby.

Returns:

  • (String)

    The name of this service. The name is the module name as used by the AWS SDK for Ruby.



27
28
29
# File 'lib/aws-partitions/service.rb', line 27

def name
  @name
end

#partition_nameString (readonly)

Returns The partition name, e.g “aws”, “aws-cn”, “aws-us-gov”.

Returns:

  • (String)

    The partition name, e.g “aws”, “aws-cn”, “aws-us-gov”.



30
31
32
# File 'lib/aws-partitions/service.rb', line 30

def partition_name
  @partition_name
end

#partition_regionString? (readonly)

Returns The global patition endpoint for this service. May be ‘nil`.

Returns:

  • (String, nil)

    The global patition endpoint for this service. May be ‘nil`.



46
47
48
# File 'lib/aws-partitions/service.rb', line 46

def partition_region
  @partition_region
end

#regionsSet<String> (readonly)

Returns The regions this service is available in. Regions are scoped to the partition.

Returns:

  • (Set<String>)

    The regions this service is available in. Regions are scoped to the partition.



34
35
36
# File 'lib/aws-partitions/service.rb', line 34

def regions
  @regions
end

Class Method Details

.build(service_name, service, partition) ⇒ 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.



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/aws-partitions/service.rb', line 62

def build(service_name, service, partition)
  Service.new(
    name: service_name,
    partition_name: partition['partition'],
    regions: regions(service, partition),
    fips_regions: variant_regions('fips', service, partition),
    dualstack_regions: variant_regions('dualstack', service, partition),
    regionalized: service['isRegionalized'] != false,
    partition_region: partition_region(service)
  )
end

Instance Method Details

#regionalized?Boolean

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

Some services have both a partition endpoint and regional endpoints.

Returns:

  • (Boolean)


55
56
57
# File 'lib/aws-partitions/service.rb', line 55

def regionalized?
  @regionalized
end