This parses endpoints from a RoleList-Role-InputEndpoint, NOT a RoleInstanceList-RoleInstance-InstanceEndpoint
 Refactor: make this an object rather than a hash..?
356019
def parse_endpoint(inputendpoint_xml)
      hash = Hash.new
      %w{LoadBalancedEndpointSetName LocalPort Name Port Protocol EnableDirectServerReturn LoadBalancerName IdleTimeoutInMinutes}.each do |key|
        hash[key] = xml_content(inputendpoint_xml, key, nil)
      end
      # Protocol could be in there twice... If we have two, pick the second one as the first is for the probe.
      if inputendpoint_xml.css("Protocol").count > 1
        hash["Protocol"] = inputendpoint_xml.css("Protocol")[1].content
      end
      probe = inputendpoint_xml.css("LoadBalancerProbe")
      if probe
        hash["LoadBalancerProbe"] = Hash.new
        %w{Path Port Protocol IntervalInSeconds TimeoutInSeconds}.each do |key|
          hash["LoadBalancerProbe"][key] = xml_content(probe, key, nil)
        end
      end
      hash
    end
459008
def parse_options(cls, options):
        
        options = options.copy()
        subdomain = options.pop('subdomain', None)
        endpoint = options.pop('endpoint', None)
        return subdomain, endpoint, options,
1277731
def _attach_endpoints(self):
        """"""
        for name, endpoint in inspect.getmembers(self):
            if inspect.isclass(endpoint) and issubclass(endpoint, self._Endpoint) and (endpoint is not self._Endpoint):
                endpoint_instance = endpoint(self.base_requester)
                setattr(self, endpoint_instance.endpoint, endpoint_instance)
1316737
def fromBasicServiceEndpoint(cls, endpoint):
        """"""
        type_uris = endpoint.matchTypes(cls.openid_type_uris)

        # If any Type URIs match and there is an endpoint URI
        # specified, then this is an OpenID endpoint
        if type_uris and endpoint.uri is not None:
            openid_endpoint = cls()
            openid_endpoint.parseService(
                endpoint.yadis_url,
                endpoint.uri,
                endpoint.type_uris,
                endpoint.service_element)
        else:
            openid_endpoint = None

        return openid_endpoint
1268328
def from_export(cls, endpoint):
        # type: (ExportEndpoint) -> EndpointDescription
        
        assert isinstance(endpoint, ExportEndpoint)

        # Service properties
        properties = endpoint.get_properties()

        # Set import keys
        properties[pelix.remote.PROP_ENDPOINT_ID] = endpoint.uid
        properties[pelix.remote.PROP_IMPORTED_CONFIGS] = endpoint.configurations
        properties[
            pelix.remote.PROP_EXPORTED_INTERFACES
        ] = endpoint.specifications

        # Remove export keys
        for key in (
            pelix.remote.PROP_EXPORTED_CONFIGS,
            pelix.remote.PROP_EXPORTED_INTERFACES,
            pelix.remote.PROP_EXPORTED_INTENTS,
            pelix.remote.PROP_EXPORTED_INTENTS_EXTRA,
        ):
            try:
                del properties[key]
            except KeyError:
                pass

        # Other information
        properties[pelix.remote.PROP_ENDPOINT_NAME] = endpoint.name
        properties[
            pelix.remote.PROP_ENDPOINT_FRAMEWORK_UUID
        ] = endpoint.framework

        return EndpointDescription(None, properties)
586979
private void loadEndpointParserProperties() {
        try {
            endpointParserProperties = PropertiesLoaderUtils.loadProperties(new ClassPathResource("com/consol/citrus/endpoint/endpoint.parser"));
        } catch (IOException e) {
            log.warn("Unable to laod default endpoint annotation parsers from resource '%s'", e);
        }
    }
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
1050478
def json_2_endpoint(json_obj):
        
        LOGGER.debug("Endpoint.json_2_endpoint")
        if MappingService.driver_type != DriverFactory.DRIVER_REST:
            if 'endpointProperties' in json_obj:
                properties = DriverTools.json2properties(json_obj['endpointProperties'])
            else:
                properties = None
        else:
            properties = json_obj['endpointProperties'] if 'endpointProperties' in json_obj else None

        return Endpoint(
            eid=json_obj['endpointID'],
            url=json_obj['endpointURL'],
            parent_node_id=json_obj['endpointParentNodeID'] if 'endpointParentNodeID' in json_obj else None,
            twin_endpoints_id=json_obj['endpointTwinEndpointsID'],
            properties=properties,
            ignore_sync=True
        )
1215880
def from_inline(cls: Type[UnknownEndpointType], inline: str) -> UnknownEndpointType:
        
        try:
            api = inline.split()[0]
            properties = inline.split()[1:]
            return cls(api, properties)
        except IndexError:
            raise MalformedDocumentError(inline)
551870
protected void obtainEndpoints(List<Node> nodes, List<EndpointInfo> endpoints) {
        for (int i = 0; i < nodes.size(); i++) {
            Node node = nodes.get(i);

            if (node.getUri() != null) {
                EndpointInfo ei=new EndpointInfo();
                ei.setEndpoint(EndpointUtil.encodeEndpoint(node.getUri(), node.getOperation()));

                if (!endpoints.contains(ei)) {
                    initEndpointInfo(ei);
                    endpoints.add(ei);
                }
            }

            if (node instanceof ContainerNode) {
                obtainEndpoints(((ContainerNode) node).getNodes(), endpoints);
            }
        }
    }
137734
def _parse_description(self, node):
        # type: (ElementTree.Element) -> EndpointDescription
        
        endpoint = {}
        for prop_node in node.findall(TAG_PROPERTY):
            name, value = self._parse_property(prop_node)
            endpoint[name] = value

        return EndpointDescription(None, endpoint)
90406
@Override
  public <T extends IncomingDataPoint> List<T> parsePutV1(
      final Class<T> type, final TypeReference<ArrayList<T>> typeReference) {
    if (!query.hasContent()) {
      throw new BadRequestException("Missing request content");
    }

    // convert to a string so we can handle character encoding properly
    final String content = query.getContent().trim();
    final int firstbyte = content.charAt(0);
    try {
      if (firstbyte == '{') {
        final T dp =
          JSON.parseToObject(content, type);
        final ArrayList<T> dps =
          new ArrayList<T>(1);
        dps.add(dp);
        return dps;
      } else if (firstbyte == '[') {
        return JSON.parseToObject(content, typeReference);
      } else {
        throw new BadRequestException("The JSON must start as an object or an array");
      }
    } catch (IllegalArgumentException iae) {
      throw new BadRequestException("Unable to parse the given JSON", iae);
    }
  }
788290
def to_obj
    # If this is not a "entry_list" response, just return
    return @response unless @response && @response["entry_list"]
    
    objects = []
    @response["entry_list"].each do |object|
      attributes = []
      _module    = resolve_module(object)
      attributes = flatten_name_value_list(object)
      namespace = @session.namespace_const
      if namespace.const_get(_module)
        if attributes.length == 0
          raise AttributeParsingError, "response contains objects without attributes!"
        end
        objects << namespace.const_get(_module).new(attributes) 
      else
        raise InvalidModule, "#{_module} does not exist, or is not accessible"
      end
    end
    # If we only have one result, just return the object
    if objects.length == 1 && !@options[:always_return_array]
      return objects[0]
    else
      return objects
    end
  end
230853
def my_shared_endpoint_list(endpoint_id):
    
    client = get_client()
    ep_iterator = client.my_shared_endpoint_list(endpoint_id)

    formatted_print(ep_iterator, fields=ENDPOINT_LIST_FIELDS)
1031062
function Base(client, endpoint) {
	var base = this;

	/**
	 * Get a list of all records for the current API
	 *
	 * @method list
	 * @param {Object} query - OPTIONAL querystring params
	 * @param {Function} callback
	 */
	base.list = function() {
		return function(query, callback) {
			var q = '';

			if (query && 'function' === typeof callback)
				q = '?' + querystring.stringify(query);

			client.exec({
				path: '/' + endpoint + q
			}, arguments[arguments.length - 1]);
		};
	};

	/**
	 * Get a single record by its key
	 *
	 * @method fetch
	 * @param {Integer|String} key
	 * @param {Function} callback
	 */
	base.fetch = function() {
		return function(key, callback) {
			client.exec({
				path: '/' + endpoint + '/' + key
			}, callback);
		};
	};

	/**
	 * Create a new record
	 *
	 * @method create
	 * @param {Object|String} data
	 * @param {Function} callback
	 */
	base.create = function() {
		return function(data, callback) {
			client.exec({
				method: 'POST',
				path: '/' + endpoint,
				body: data
			}, callback);
		};
	};

	/**
	 * Update a record
	 *
	 * @method update
	 * @param {Integer|String} key
	 * @param {Object|String} data
	 * @param {Function} callback
	 */
	base.update = function() {
		return function(key, data, callback) {
			client.exec({
				method: 'PUT',
				path: '/' + endpoint + '/' + key,
				body: data
			}, callback);
		};
	};

	/**
	 * Remove a record
	 *
	 * @method remove
	 * @param {Integer|String} key
	 * @param {Function} callback
	 */
	base.remove = function() {
		return function(key, callback) {
			client.exec({
				method: 'DELETE',
				path: '/' + endpoint + '/' + key
			}, callback);
		};
	};

	/**
	 * Do requested action
	 *
	 * @method doAction
	 * @param {Integer|String} key
	 * @param {String} action
	 * @param {Object} body
	 * @param {Function} callback
	 */
	base.doAction = function() {
		return function(key, action, body, callback) {
			body = body || {};
			body.type = action;

			client.exec({
				method: 'POST',
				path: '/' + endpoint + '/' + key + '/actions',
				body: body
			}, callback);
		};
	};
}
1189876
private RestEndpointGroup getEndpointGroup(String commandLine) {
        if (commandLine == null) {
            return null;
        }
        StringTokenizer st = new StringTokenizer(commandLine);
        String operation = nextToken(st);
        // If the operation doesn't have a parser, then it's unknown.
        if (parsers.getParser(operation) == null) {
            return null;
        }
        // the operation is a HTTP method so the next token should be a resource path
        String requestUri = nextToken(st);
        return requestUri != null ? getHttpApiEndpointGroup(operation, requestUri) : null;
    }
181429
def from_api_repr(cls, resource):
        
        name = resource.get("name")
        type_ = resource["parameterType"]["type"]
        value = resource["parameterValue"]["value"]
        converted = _QUERY_PARAMS_FROM_JSON[type_](value, None)
        return cls(name, type_, converted)