@param string $client_id

@return array
511001
protected function get_oauth_link_query( $client_id ) {
		return $this->filter_oauth_link_query( [
			'client_id'     => $client_id,
			'redirect_uri'  => $this->apply_filters( $this->get_service_name() . '_oauth_redirect_uri' ),
			'scope'         => $this->get_config_value( 'scope' ),
			'response_type' => 'code',
			'state'         => $this->get_state(),
		], $client_id );
	}
293122
public function getBranch($clientId)
    {
        if (!is_int($clientId)) {
            throw new \InvalidArgumentException('Client ID must be an integer.');
        }

        $xml = $this->execute(sprintf('branch/%s', $clientId));

        $branch = new Branch;
        $branch->setClientId($clientId);
        $branch->setFirmId(self::normalise($xml{'FirmID'}, 'int'));
        $branch->setBranchId(self::normalise($xml->{'BranchID'}, 'int'));
        $branch->setName(self::normalise($xml->name, 'string'));
        $branch->setStreet(self::normalise($xml->street, 'string'));
        $branch->setTown(self::normalise($xml->town, 'string'));
        $branch->setCounty(self::normalise($xml->county, 'string'));
        $branch->setPostcode(self::normalise($xml->postcode, 'string'));
        $branch->setPhone(self::normalise($xml->phone, 'string'));
        $branch->setEmail(self::normalise($xml->email, 'string'));

        return $branch;
    }
1012069
public function client($id)
    {
        if (isset($this->clients[$id])) {
            return $this->clients[$id];
        }

        return new Client($this, $id);
    }
638748
protected function oAuthPostRequest($grant_type, $client_id, $client_secret)
    {
        // verify the required parameter 'grant_type' is set
        if ($grant_type === null) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $grant_type when calling oAuthPost'
            );
        }
        // verify the required parameter 'client_id' is set
        if ($client_id === null) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $client_id when calling oAuthPost'
            );
        }
        // verify the required parameter 'client_secret' is set
        if ($client_secret === null) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $client_secret when calling oAuthPost'
            );
        }

        $resourcePath = '/oauth2/token';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;



        // form params
        if ($grant_type !== null) {
            $formParams['grant_type'] = ObjectSerializer::toFormValue($grant_type);
        }
        // form params
        if ($client_id !== null) {
            $formParams['client_id'] = ObjectSerializer::toFormValue($client_id);
        }
        // form params
        if ($client_secret !== null) {
            $formParams['client_secret'] = ObjectSerializer::toFormValue($client_secret);
        }
        // body params
        $_tempBody = null;

        if ($multipart) {
            $headers = $this->headerSelector->selectHeadersForMultipart(
                ['application/json']
            );
        } else {
            $headers = $this->headerSelector->selectHeaders(
                ['application/json'],
                ['application/x-www-form-urlencoded']
            );
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            // $_tempBody is the method argument, if present
            $httpBody = $_tempBody;
            // \stdClass has no __toString(), so we should encode it manually
            if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
                $httpBody = \GuzzleHttp\json_encode($httpBody);
            }
            else if (gettype($httpBody) == 'array' && $headers['Content-Type'] === 'application/json') {
                $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $multipartContents[] = [
                        'name' => $formParamName,
                        'contents' => $formParamValue
                    ];
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif ($headers['Content-Type'] === 'application/json') {
                $httpBody = \GuzzleHttp\json_encode($formParams);

            } else {
                // for HTTP post (form)
                $httpBody = \GuzzleHttp\Psr7\build_query($formParams);
            }
        }


        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }
        if($this->config->getAccessToken()!==''){
            $defaultHeaders['Authorization']= 'Bearer ' . $this->config->getAccessToken();
        }
        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = \GuzzleHttp\Psr7\build_query($queryParams);
        return new Request(
            'POST',
            $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }
760767
public function clientId()
	{
		if (isset($this->client_id)) {
			return $this->client_id ? $this->client_id : null;
		}
		
		if (!$this->check()) {
			return null;
		}
		
		if (Request::input('client_id')) {
			$this->client_id = Request::input('client_id');
		}
		else if ($id = Authorizer::getClientId()) {
			$this->client_id = $id;
		}
		else {
			$this->client_id = false;
		}
		
		return $this->client_id ? $this->client_id : null;
	}
1256791
public function checkClientCredentials($client_id, $client_secret = null)
    {
        $client = $this->getClientDetails($client_id);
        return isset($client['client_secret'])
            && $client['client_secret'] == $client_secret;
    }
1303590
public function updateCustomer($customer_id)
    {
        $data = [
            "email" => request()->email,
            "first_name" => request()->fname,
            "last_name" => request()->lname,
            "phone" => request()->phone,
            "metadata" => request()->additional_info /* key => value pairs array */

        ];

        $this->setRequestOptions();
        return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse();
    }
728728
public function getClientKey($client_id, $subject)
    {
        if (isset($this->jwt[$client_id])) {
            $jwt = $this->jwt[$client_id];
            if ($jwt) {
                if ($jwt["subject"] == $subject) {
                    return $jwt["key"];
                }
            }
        }

        return null;
    }
1275416
public function setClientUser($client_id, $user_id)
    {
        if ($this->getClientUser($client_id, $user_id)) {
            return true;
        } else {
            $created_at = date('Y-m-d H:i:s');
            $sql        = 'INSERT INTO %s (client_id, user_id, created_at) VALUES (:client_id, :user_id, :created_at)';
            $sql        = sprintf($sql, $this->config['client_user_table']);

            $params = array_map('trim', compact('client_id', 'user_id', 'created_at'));

            return $this->db->prepare($sql)->execute($params);
        }
    }
164794
public function getTransactionContent(int $character_id, int $client_id)
    {

        $transactions = $this->characterWalletTransactionInteraction($character_id, $client_id);

        return DataTables::of($transactions)
            ->editColumn('is_buy', function ($row) {

                return view('web::partials.transactionbuysell', compact('row'));
            })
            ->editColumn('unit_price', function ($row) {

                return number($row->unit_price);
            })
            ->addColumn('item_view', function ($row) {
                return view('web::partials.transactiontype', compact('row'));
            })
            ->addColumn('total', function ($row) {

                return number($row->unit_price * $row->quantity);
            })
            ->addColumn('client_view', function ($row) {

                $character_id = $row->character_id;

                $character = CharacterInfo::find($row->client_id) ?: $row->client_id;

                return view('web::partials.character', compact('character', 'character_id'));
            })
            ->rawColumns(['is_buy', 'client_view', 'item_view'])
            ->make(true);
    }
94694
private function getClientSidePropertiesToSet()
    {
        $result = array();

        foreach ($this->config->clientSideProperties as $name) {
            if (property_exists($this->requestConfig, $name)) {
                $result[$name] = $this->getIntIfValueIsBool($this->requestConfig->$name);
            } elseif (property_exists($this->config, $name)) {
                $result[$name] = $this->getIntIfValueIsBool($this->config->$name);
            }
        }

        return $result;
    }
877081
public static function get($client, $id) {
    $response = $client->get(static::$path . '/' . $id);

    $class = get_called_class();
    return new $class($client, $response->json());
  }
517388
public static function byId(
        Client $client,
        int $id
    ): self {
        $posts = self::search($client, ['id:' . $id], 1, 1);

        if (count($posts) === 0) {
            throw new PostNotFoundException(sprintf(
                'Post with ID %d not found',
                $id
            ));
        }

        return $posts[0];
    }
722351
def client_secrets(cls, client_id):
        
        secrets = yield cls.view.get(key=client_id, include_docs=True)
        raise Return([cls(**secret['doc']) for secret in secrets['rows']])
918112
public function getClientsAndContentTypesAsChoices(): array
    {
        $clientsAndContentTypes = [];

        foreach ($this->clientsConfig as $clientName => $clientConfig) {
            /** @var \Contentful\Delivery\Client $client */
            $client = $clientConfig['service'];

            $clientsAndContentTypes[$client->getSpace()->getName()] = $clientName;
            foreach ($client->getContentTypes()->getItems() as $contentType) {
                /* @var \Contentful\Delivery\Resource\ContentType $contentType */
                $clientsAndContentTypes['>  ' . $contentType->getName()] = $clientName . '|' . $contentType->getId();
            }
        }

        return $clientsAndContentTypes;
    }
1307007
public function getTemplate($client_id = 0, $id = 0)
	{
		if (!$this->app->has('cache.store') || !($cache = $this->app['cache.store']))
		{
			$cache = new \Hubzero\Cache\Storage\None(array('hash' => $this->app->hash('template.loader')));
		}

		$templates = $cache->get('com_templates.templates' . $client_id . $this->lang);

		if (!$templates || empty($templates))
		{
			try
			{
				$db = $this->app['db'];

				$s = '#__template_styles';
				$e = '#__extensions';

				$query = new Query($db);
				$query
					->select($s . '.id')
					->select($s . '.home')
					->select($s . '.template')
					->select($s . '.params')
					->select($e . '.protected')
					->from($s)
					->join($e, $e . '.element', $s . '.template')
					->whereEquals($s . '.client_id', (int)$client_id)
					->whereEquals($e . '.enabled', 1)
					->whereEquals($e . '.type', 'template')
					->whereRaw($e . '.`client_id` = `' . $s . '`.`client_id`');

				if ($id)
				{
					$query->whereEquals($s . '.id', $id);
				}

				$query->order('home', 'desc');

				$db->setQuery($query->toString());
				$templates = $db->loadObjectList('id');

				foreach ($templates as $i => $template)
				{
					$template->params = new Registry($template->params);

					if (substr($template->template, 0, 4) == 'tpl_')
					{
						$template->template = substr($template->template, 4);
					}

					if (is_dir($this->getPath('app') . DIRECTORY_SEPARATOR . $template->template))
					{
						$template->path = $this->getPath('app') . DIRECTORY_SEPARATOR . $template->template;
					}
					else
					{
						$template->path = $this->getPath('core') . DIRECTORY_SEPARATOR . $template->template;
					}

					$templates[$i] = $template;

					// Create home element
					if ($template->home && !isset($templates[0]))
					{
						$templates[0] = clone $template;
					}
				}

				$cache->put('com_templates.templates' . $client_id . $this->lang, $templates, $this->app['config']->get('cachetime', 15));
			}
			catch (Exception $e)
			{
				$templates = array();
			}
		}

		$tmpl = null;

		if (isset($templates[$id]))
		{
			$tmpl = $templates[$id];
		}
		else if (isset($templates[0]))
		{
			$tmpl = $templates[0];
		}

		if ($tmpl && file_exists($tmpl->path . DIRECTORY_SEPARATOR . 'index.php'))
		{
			return $tmpl;
		}

		return $this->getSystemTemplate();
	}
734287
public static function fetchByClientId( $clientId )
    {
        $session = ezcPersistentSessionInstance::get();

        $q = $session->createFindQuery( __CLASS__ );
        $q->where( $q->expr->eq( 'client_id', $q->bindValue( $clientId ) ) );
        $results = $session->find( $q, __CLASS__ );
        if ( count( $results ) != 1 )
            return false;
        else
            return array_shift( $results );
    }