Generate an enpoint url from a setting name.

        Args:
            endpoint_name(str): setting name for the enpoint to build

        Returns:
            (str) url enpoint
350509
def _build_endpoint(self, endpoint_name):
        
        endpoint_relative = settings.get('asmaster_endpoints', endpoint_name)
        return '%s%s' % (self.host, endpoint_relative)
73826
function createUrlFromEndpointAndOptions (endpoint, options) {
  const query = qs.stringify(options);
  const baseURL = `${host}${endpoint}`;
  return query ? `${baseURL}?${query}` : baseURL;
}
18938
def endpoint_type(self, endpoint_type):
        
        if endpoint_type is not None and len(endpoint_type) > 64:
            raise ValueError("Invalid value for `endpoint_type`, length must be less than or equal to `64`")

        self._endpoint_type = endpoint_type
1183737
def url_for(endpoint, default="senaite.jsonapi.get", **values):
    

    try:
        return router.url_for(endpoint, force_external=True, values=values)
    except Exception:
        # XXX plone.jsonapi.core should catch the BuildError of Werkzeug and
        #     throw another error which can be handled here.
        logger.debug("Could not build API URL for endpoint '%s'. "
                     "No route provider registered?" % endpoint)

        # build generic API URL
        return router.url_for(default, force_external=True, values=values)
300056
def get_endpoint_map(self):
        
        log.debug("getting end points...")
        cmd, url = DEVICE_URLS["get_endpoint_map"]
        return self._exec(cmd, url)
1210450
private Retrofit.Builder setEndpoint(Retrofit.Builder retrofitBuilder, String endpoint) {
    if (endpoint != null) {
      return retrofitBuilder.baseUrl(endpoint);
    }
    return retrofitBuilder;
  }
158473
def default_endpoint_from_config(config, option=None):
    """"""
    default_endpoint = config.get('core', {}).get('default')
    project_endpoint = config.get('project',
                                  {}).get('core',
                                          {}).get('default', default_endpoint)
    return Endpoint(
        option or project_endpoint or default_endpoint,
        default=default_endpoint,
        project=project_endpoint,
        option=option
    )
641428
def is_valid_endpoint_host(interfaces, endpoint):
        
        result = urlparse(endpoint)
        hostname = result.hostname
        if hostname is None:
            return False

        for interface in interfaces:
            if interface == hostname:
                return False

        return True
69006
def _get_api_url(self, secure=None, **formatters):
        '''
        '''
        if self.endpoint is None:
            raise NotImplementedError('endpoint must be defined on a subclass')
        if secure is None:
            secure = self.secure
        if secure:
            api_url = POSTMARK_API_URL_SECURE
        else:
            api_url = POSTMARK_API_URL
        url = urljoin(api_url, self.endpoint)
        if formatters:
            url = url.format(**formatters)
        return url
384474
def get_endpoint(cls):
        
        if cls.endpoint is not None:
            return cls.endpoint
        s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', cls.__name__)
        return cls.sanitize_ep(
            re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower(),
            plural=True
        )
15923
def endpoint(params)
      params.each_pair do |param_name, param_value|
        case param_name
          when :summary
            endpoint_summary param_value
          when :description
            endpoint_description param_value
          when :tags
            endpoint_tags *param_value
          when :produces
            endpoint_produces *param_value
          when :path
            endpoint_path param_value
          when :parameters
            param_value.each do |param, args_param|
              endpoint_parameter param, *args_param
            end
          when :responses
            param_value.each do |code, args_response|
              endpoint_response code, *args_response
            end
          else
            raise SwaggerInvalidException.new("Invalid endpoint parameter [#{param_name}]")
        end
      end
    end
817844
def __get_url(self, endpoint):
        
        url = self.url
        api = "wc-api"

        if url.endswith("/") is False:
            url = "%s/" % url

        if self.wp_api:
            api = "wp-json"

        return "%s%s/%s/%s" % (url, api, self.version, endpoint)
13419
def get_endpoints():
        
        LOGGER.debug("EndpointService.get_endpoints")
        params = SessionService.complete_transactional_req(None)
        if params is None:
            if MappingService.driver_type != DriverFactory.DRIVER_REST:
                params = {'OPERATION': 'getEndpoints'}
                args = {'properties': params}
            else:
                args = {'http_operation': 'GET', 'operation_path': ''}
        else:
            if MappingService.driver_type != DriverFactory.DRIVER_REST:
                params['OPERATION'] = 'getEndpoints'
                args = {'properties': params}
            else:
                args = {'http_operation': 'GET', 'operation_path': '', 'parameters': params}

        response = EndpointService.requester.call(args)

        if MappingService.driver_type != DriverFactory.DRIVER_REST:
            response = response.get()

        ret = None
        if response.rc == 0:
            ret = []
            for endpoint in response.response_content['endpoints']:
                ret.append(Endpoint.json_2_endpoint(endpoint))
        elif response.rc != 404:
            err_msg = 'EndpointService.get_endpoints - Problem while getting nodes. ' \
                      'Reason: ' + str(response.response_content) + ' - ' + str(response.error_message) + \
                      " (" + str(response.rc) + ")"
            LOGGER.warning(err_msg)
            if response.rc == 500 and ArianeMappingOverloadError.ERROR_MSG in response.error_message:
                raise ArianeMappingOverloadError("EndpointService.get_endpoints",
                                                 ArianeMappingOverloadError.ERROR_MSG)
            # traceback.print_stack()
        return ret
677040
def delete_endpoint(self, endpoint_name):
        
        LOGGER.info('Deleting endpoint with name: {}'.format(endpoint_name))
        self.sagemaker_client.delete_endpoint(EndpointName=endpoint_name)
476977
def _attach_endpoints(self):
        """"""
        for name, value in inspect.getmembers(self):
            if inspect.isclass(value) and issubclass(value, self._Endpoint) and (value is not self._Endpoint):
                endpoint_instance = value(self.requester)
                setattr(self, endpoint_instance.endpoint_base, endpoint_instance)
                if not hasattr(endpoint_instance, 'get_endpoints'):
                    endpoint_instance.get_endpoints = ()
                if not hasattr(endpoint_instance, 'post_endpoints'):
                    endpoint_instance.post_endpoints = ()
                if not hasattr(endpoint_instance, 'is_callable'):
                    endpoint_instance.is_callable = False
                for endpoint in (endpoint_instance.get_endpoints + endpoint_instance.post_endpoints):
                    function = endpoint_instance.create_endpoint_function(endpoint)
                    function_name = endpoint.replace('/', '_')
                    setattr(endpoint_instance, function_name, function)
                    function.__name__ = str(function_name)
                    function.__doc__ = 'Tells the object to make a request to the {0} endpoint'.format(endpoint)
37953
def build_url(self, _name, **kwargs):
        '''
        
        '''
        used_args, subreverse =  self._build_url_silent(_name, **kwargs)

        if set(kwargs).difference(used_args):
            raise UrlBuildingError(
                'Not all arguments are used during URL building: {}'\
                    .format(', '.join(set(kwargs).difference(used_args))))
        return subreverse.as_url
682282
def generate_url(self, name: str, **kwargs) -> str:
        
        return self.urlmapper.generate(name, **kwargs)