/* USERS ENDPOINTS
4718
@Override
    public InstagramPaginatingResponse<InstagramFeedItem> getSelfFeed(String accessToken,
                                                                      int count,
                                                                      String maxContentId,
                                                                      String minContentId) throws InstagramError {
        return instagramEndpoints.getSelfFeed(accessToken, count, maxContentId, minContentId);
    }
370436
@RequestMapping(
            value = USERINFO_ENDPOINT_URI,
            produces = USERINFO_CONTENT_TYPE,
            method = {RequestMethod.GET, RequestMethod.POST})
    public String userInfo(
            HttpServletRequest request,
            @RequestParam(value = "claims", required = false) String claims,
            @RequestParam(value = "groups", required = false) String groups) {

        final IPerson person = personManager.getPerson(request);
        return createToken(person, claims, groups);
    }
288122
public function endpoints_table($endpoints, $issuerid) {
        global $CFG;

        $table = new html_table();
        $table->head  = [
            get_string('name'),
            get_string('url'),
            get_string('edit'),
        ];
        $table->attributes['class'] = 'admintable generaltable';
        $data = [];

        $index = 0;

        foreach ($endpoints as $endpoint) {
            // Name.
            $name = $endpoint->get('name');
            $namecell = new html_table_cell(s($name));
            $namecell->header = true;

            // Url.
            $url = $endpoint->get('url');
            $urlcell = new html_table_cell(s($url));

            $links = '';
            // Action links.
            $editparams = ['issuerid' => $issuerid, 'endpointid' => $endpoint->get('id'), 'action' => 'edit'];
            $editurl = new moodle_url('/admin/tool/oauth2/endpoints.php', $editparams);
            $editlink = html_writer::link($editurl, $this->pix_icon('t/edit', get_string('edit')));
            $links .= ' ' . $editlink;

            // Delete.
            $deleteparams = ['issuerid' => $issuerid, 'endpointid' => $endpoint->get('id'), 'action' => 'delete'];
            $deleteurl = new moodle_url('/admin/tool/oauth2/endpoints.php', $deleteparams);
            $deletelink = html_writer::link($deleteurl, $this->pix_icon('t/delete', get_string('delete')));
            $links .= ' ' . $deletelink;

            $editcell = new html_table_cell($links);

            $row = new html_table_row([
                $namecell,
                $urlcell,
                $editcell,
            ]);

            $data[] = $row;
            $index++;
        }
        $table->data = $data;
        return html_writer::table($table);
    }
45813
function Client(endpointUrl, sourceId) {
		this.restClient = new restClient.Client();

		this.endpointUrl = endpointUrl;

		if (this.endpointUrl) {
			// Remove the trailing slash if necessary
			if (this.endpointUrl.indexOf('/', this.endpointUrl.length - 1) !== -1) {
				this.endpointUrl = this.endpointUrl.substr(0, this.endpointUrl.length - 2);
			}

			// Add the default version if not present
			// TODO: The client should take care of the version in a better way
			if (this.endpointUrl.indexOf('/v1', this.endpointUrl.length - 3) === -1) {
				this.endpointUrl = this.endpointUrl + '/v1';
			}
		}

		if (sourceId !== undefined) {
			this.sourceId = sourceId;
		}
	}
12858
protected function buildEndpoint()
    {
        $endpoint = $this->authorization->apiEndpoint . '/tables/' . $this->tableName . '/';

        // If there is a specific record ID, append that to the endpoint
        if ($this->recordID) { $endpoint .= $this->recordID; }

        return $endpoint;
    }
997732
function queryUserInfo(parentSpan, username, callback) {
    // Aggregated user information across multiple API calls
    var user = {
        login        : null,
        type         : null,
        repoNames    : [],
        recentEvents : 0,
        eventCounts  : {},
    };

    // Call the callback only when all three API requests finish or on the
    // first error.
    var remainingCalls = 3;
    var next = function (err) {
        // Early terminate on any error
        remainingCalls -= err ? Math.max(remainingCalls, 1) : 1;
        if (remainingCalls === 0) {
            callback(err, err ? null : user);
        }
    };

    // First query the user info for the given username
    httpGet(parentSpan, 'http://api.github.com/users/' + username, function (err, json) {
        if (err) {
            return next(err);
        }
        user.login = json.login;
        user.type  = json.type;

        // Use the user info to query names of all the user's public repositories
        httpGet(parentSpan, json.repos_url, function (err, json) {
            if (err) {
                return next(err);
            }
            for (var i = 0; i < json.length; i++) {
                user.repoNames.push(json[i].name);
            }
            next(null);
        });

        // In parallel, query the recent events activity for the user
        httpGet(parentSpan, json.received_events_url, function (err, json) {
            if (err) {
                return next(err);
            }
            user.recentEvents = json.length;
            for (var i = 0; i < json.length; i++) {
                var eventType = json[i].type;
                user.eventCounts[eventType] = user.eventCounts[eventType] || 0;
                user.eventCounts[eventType]++;
            }
            next(null);
        });

        next(null);
    });
}
810938
private void validateEndpoint(String endpoint) {
        try {
            new URL(endpoint);
        } catch (MalformedURLException e) {
            throw new InvalidParameterException(Messages.i18n.format("OrganizationResourceImpl.InvalidEndpointURL")); //$NON-NLS-1$
        }
    }
1163850
function fetchUsersCycle(sources) {
  const accessToken$ = accessTokenSelector$(sources.STATE);

  const resNeedFetch = R.pathSatisfies(R.contains(R.__, [CREATE_USER_BY_CSV]), [
    'request',
    'category',
  ]);

  const request$ = Observable.merge(
    sources.ACTION.filter(action => action.type === FETCH_USERS),
    sources.HTTP.select()
      .concatMap(success)
      .filter(resNeedFetch),
  ).combineLatest(accessToken$, (s, accessToken) => ({
    url: '/api/users',
    method: 'GET',
    headers: { Authorization: `Bearer ${accessToken}` },
    category: FETCH_USERS,
  }));

  const successRes$ = sources.HTTP.select(FETCH_USERS).switchMap(success);

  const action$ = Observable.from([
    request$.mapTo(uiActions.setLoading()),
    successRes$.pluck('body').map(setUsers),
    successRes$.mapTo(uiActions.setLoaded()),
  ]).mergeAll();

  return {
    ACTION: action$,
    HTTP: request$,
  };
}
524878
function (settings) {
  validatePresenceOfOptions(settings, ['urlTemplate', 'userName']);

  if (settings.templateName) {
    this.endpoints = {
      get: [WindshaftConfig.MAPS_API_BASE_URL, 'named', settings.templateName, 'jsonp'].join('/'),
      post: [WindshaftConfig.MAPS_API_BASE_URL, 'named', settings.templateName].join('/')
    };
  } else {
    this.endpoints = {
      get: WindshaftConfig.MAPS_API_BASE_URL,
      post: WindshaftConfig.MAPS_API_BASE_URL
    };
  }

  this.url = settings.urlTemplate.replace('{user}', settings.userName);
  this._requestTracker = new RequestTracker(MAP_INSTANTIATION_LIMIT);
}
704473
function buildEndpointServices(services = [], numZones = 0) {
  if (!Array.isArray(services) || services.length < 1) {
    return {};
  }
  if (numZones < 1) {
    return {};
  }

  const subnetIds = [];
  const routeTableIds = [];
  for (let i = 1; i <= numZones; i += 1) {
    subnetIds.push({ Ref: `${APP_SUBNET}Subnet${i}` });
    routeTableIds.push({ Ref: `${APP_SUBNET}RouteTable${i}` });
  }

  const resources = {};
  services.forEach(service => {
    Object.assign(resources, buildVPCEndpoint(service, { routeTableIds, subnetIds }));
  });

  return resources;
}
79111
public function listEndpoints() {
    $uri = new URIResource($this->path, array($this->id, "endpoints"));

    return new EndpointsCollection(new DataPacketCollection($this->client->get((string) $uri)));
  }
1197813
def user_disable_throw_rest_endpoint(self, username, url='rest/scriptrunner/latest/custom/disableUser',
                                         param='userName'):
        """"""
        url = "{}?{}={}".format(url, param, username)
        return self.get(path=url)
923433
protected function buildRequestUrl($endpoint, $params = null)
    {
        if($this->user == null)
            throw new Exception("Please authenticate user first!");

        $requestPath = $this->requestPath . $endpoint . ".json". $this->getParams( $params );

        return $requestPath;
    }
361060
public function getEndpoints()
    {
        $uri = 'endpoints';
        $response = $this->client->getEndpoint()->get($uri);

        $endpoints = [];
        foreach (\GuzzleHttp\json_decode($response->getBody()) as $endpoint) {
            $endpoints[] = new Endpoint($this->client, $endpoint);
        }

        return $endpoints;
    }
533637
public function endpoint() {
		$endpoint = $this->getset('endpoint', func_get_args());
		return $this->validateEndpoint($endpoint ?: self::URI_API);
	}
703090
def create_endpoint(data)
      headers = @client.make_request(:post, @client.concat_user_path("#{DOMAIN_PATH}/#{id}/endpoints"), data)[1]
      id = Client.get_id_from_location_header(headers[:location])
      get_endpoint(id)
    end
1198423
function createEndPoint (local) {
  var endPoint = new EndPoint(local), local = endPoint.local;
  if (!endPoints[local.port]) endPoints[local.port] = {};
  return endPoints[local.port][local.address] = endPoint;
}