class Aws::Partitions::EndpointProvider

def credential_scope(region, service, is_global_fn)

def credential_scope(region, service, is_global_fn)
  partition = get_partition(region)
  service_cfg = partition.fetch('services', {})
                         .fetch(service, {})
  endpoints = service_cfg.fetch('endpoints', {})
  # Check for global endpoint.
  if is_global_fn.call(service, region, endpoints, service_cfg)
    region = service_cfg.fetch('partitionEndpoint', region)
  end
  default_credential_scope = service_cfg
                               .fetch('defaults', {})
                               .fetch('credentialScope', {})
  endpoints
    .fetch(region, {})
    .fetch('credentialScope', default_credential_scope)
end