class GetUserRequest extends Request

Traits

Properties

protected Authenticator|null $authenticator

The authenticator used in requests.

from  AuthenticatesRequests
protected BodyRepository|null $bodyRepository

The request body repository.

from  HasBody
protected null|Response> $response

The default response class.

from  HasCustomResponses
protected MockClient|null $mockClient

The operation-owned mock client.

from  HasMockClient
protected list<array<string, mixed>> $cookies

The request cookies and their attributes.

from  HasCookies
protected IntegerRepository|null $delayRepository

The request delay.

from  HasDelay
protected ArrayRepository|null $headerRepository

The request headers.

from  HasHeaders
protected MiddlewarePipeline|null $middlewarePipeline

The request middleware pipeline.

from  HasMiddleware
protected ArrayRepository|null $optionRepository

The request options.

from  HasOptions
protected ArrayRepository|null $queryRepository

The request query parameters.

from  HasQuery
protected string|null $queryString

The already-encoded query string override.

from  HasQuery
protected RetryPolicy|null $retryPolicy

The request retry policy.

from  HasRetryPolicy
static protected array $macros

The registered string macros.

from  Macroable
protected Method $method

The HTTP method used by the request.

protected string|null $url

The caller-supplied absolute URL override.

from  Request

Methods

mixed
createDtoFromResponse(Response $response)

Create a data object from the response.

defaultAuth()

Resolve the default authenticator.

authenticator()

Get the authenticator.

authenticate(Authenticator $authenticator)

Authenticate the request with an authenticator.

withToken(string $token, string $type = 'Bearer')

Authenticate the request with a token.

withBasicAuth(string $username, string $password)

Authenticate the request with basic authentication.

withDigestAuth(string $username, string $password)

Authenticate the request with digest authentication.

void
boot(PendingRequest $pendingRequest)

Configure a pending request for this resource.

from  Bootable
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

RequestInterface
handlePsrRequest(RequestInterface $request, PendingRequest $pendingRequest)

Handle the final PSR request before it is sent.

withBody(mixed $content, string|null $contentType = 'application/json')

Set the raw request body.

from  HasBody
asJson(array $data = [])

Use a JSON request body.

from  HasBody
asForm(array $data = [])

Use a URL-encoded form request body.

from  HasBody
asMultipart()

Use a multipart request body.

from  HasBody
attach(string $name, mixed $contents = '', string|null $filename = null, array $headers = [])

Attach a multipart value to the request.

from  HasBody
withData(array $data)

Merge structured values into the request body.

from  HasBody
mixed
body()

Get the resolved request body value.

from  HasBody
bool
hasBody()

Determine if the request has a body repository.

from  HasBody
copyBodyRepository()

Copy the body repository for a pending request.

from  HasBody
defaultBodyRepository()

Resolve the default body repository.

from  HasBody
bodyRepository()

Get the request body repository.

from  HasBody
string|null
resolveResponseClass(Response $response)

Resolve the custom response class.

debugRequest(callable|null $onRequest = null, bool $die = false)

Debug the final application-owned request.

debugResponse(callable|null $onResponse = null, bool $die = false)

Debug the response before ordinary response middleware.

debug(bool $die = false)

Debug both the request and response.

withMockClient(MockClient $mockClient)

Use a mock client for this request.

MockClient|null
mockClient()

Get the mock client.

bool
hasMockClient()

Determine if the request has a mock client.

withCookie(SetCookie $cookie)

Specify a cookie and its attributes for the request.

withCookies(array $cookies, string $domain)

Specify cookies that should be included with the request.

array
cookies()

Get the request cookies and their attributes.

delay(int $milliseconds)

Delay the request by the given milliseconds.

from  HasDelay
int|null
delayMilliseconds()

Get the request delay in milliseconds.

from  HasDelay
int|null
defaultDelay()

Resolve the default request delay.

from  HasDelay
delayRepository()

Get the request delay repository.

from  HasDelay
array
headers()

Get the request headers.

bool
hasHeader(string $name)

Determine if the request contains the given header.

withHeaders(array $headers)

Add headers to the request.

withHeader(string $name, mixed $value)

Add a header to the request.

replaceHeaders(array $headers)

Replace matching headers on the request.

contentType(string $contentType)

Specify the request content type.

acceptJson()

Indicate that JSON should be returned by the server.

accept(string $contentType)

Indicate the type of content that should be returned by the server.

withUserAgent(bool|string $userAgent)

Specify the request user agent.

array
defaultHeaders()

Resolve the default request headers.

headerRepository()

Get the request header repository.

middleware()

Get the request middleware pipeline.

array
options()

Get the request options.

withOptions(array $options)

Add options to the request.

maxRedirects(int $max)

Specify the maximum number of redirects to allow.

withoutRedirecting()

Indicate that redirects should not be followed.

withoutVerifying()

Indicate that TLS certificates should not be verified.

sink(resource|StreamInterface|string $to)

Specify where the response body should be stored.

timeout(float|int $seconds)

Specify the request timeout in seconds.

connectTimeout(float|int $seconds)

Specify the connection timeout in seconds.

withTelescopeTags(array $tags)

Add Telescope tags to the request.

withoutTelescope()

Disable Telescope recording for the request.

array
defaultOptions()

Resolve the default request options.

optionRepository()

Get the request option repository.

string|null
queryString()

Get the raw query string override, without a leading question mark.

from  HasQuery
withQueryString(string $query)

Replace the base URL and endpoint query string.

from  HasQuery
array
queryParameters()

Get the request query parameters.

from  HasQuery
withQueryParameters(array $parameters)

Add query parameters to the request.

from  HasQuery
array
defaultQuery()

Resolve the default request query parameters.

from  HasQuery
string|null
defaultQueryString()

Resolve the default raw query string override.

from  HasQuery
queryRepository()

Get the request query repository.

from  HasQuery
retry(array|int $times, Closure|int $sleepMilliseconds = 0, callable|null $when = null, bool $throw = true)

Specify the number of times the request should be attempted.

retryPolicy()

Get the request retry policy.

static void
macro(string $name, callable|object $macro)

Register a custom macro.

static void
mixin(object $mixin, bool $replace = true)

Mix another object into the class.

static bool
hasMacro(string $name)

Check if macro is registered.

static void
flushMacros()

Flush the existing macros.

static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

mixed
__call(string $method, array $parameters)

Dynamically handle calls to the class.

static Makeable
make(mixed ...$arguments)

Create a new instance with the given arguments.

from  Makeable
bool|null
hasRequestFailed(Response $response)

Determine if the request failed.

getRequestException(Response $response)

Resolve the request exception.

bool
shouldThrowRequestException(Response $response)

Determine if the response should throw a request exception.

static static
newInstance()

Create a fresh request for container resolution.

from  Request
Method
method()

Get the HTTP method used by the request.

from  Request
string
resolveEndpoint()

Resolve the user endpoint.

string|null
url()

Get the absolute URL override.

from  Request
withUrl(string $url)

Replace the connector base URL and request endpoint.

from  Request
bool|null
allowsBaseUrlOverride()

Resolve whether the trusted OAuth endpoint may replace the connector base URL.

bool
usesCachingControls()

Determine if this request defines cache controls.

from  Request
bool
cachingEnabled()

Determine if caching is enabled for this request.

from  Request
bool
shouldInvalidateCache()

Determine if the matching cache entry should be invalidated.

from  Request
string|null
resolveCacheKey(PendingRequest $pendingRequest)

Resolve the request's custom cache key.

from  Request
array|null
resolveCacheableMethods()

Resolve the request's cacheable HTTP methods.

from  Request
bool
usesRateLimits()

Determine if this request defines rate limits.

from  Request
array
resolveRateLimitPolicies(PendingRequest $pendingRequest)

Resolve the request's admission policies.

from  Request
UnitEnum|string|null
resolveRateLimitStoreName()

Resolve the request's rate limiter store.

from  Request
bool
shouldWaitForRateLimits()

Determine if request rate limits should be awaited.

from  Request
string
resolveRateLimitCooldownKeyFor(PendingRequest $pendingRequest)

Resolve the request's stable cooldown key.

from  Request
int|null
resolveRateLimitCooldownFor(Response $response)

Resolve the request cooldown imposed by a response.

from  Request
void
__clone()

Clone the request's initialized mutable state.

from  Request
static void
flushState()

Flush all static state.

from  Request
void
bootAcceptsJson(PendingRequest $pendingRequest)

Apply the JSON response preference.

__construct(OAuthConfig $oauthConfig)

Create an OAuth user request.

Details

mixed createDtoFromResponse(Response $response)

Create a data object from the response.

Parameters

Response $response

Return Value

mixed

protected Authenticator|null defaultAuth()

Resolve the default authenticator.

Return Value

Authenticator|null

Authenticator|null authenticator()

Get the authenticator.

Return Value

Authenticator|null

AuthenticatesRequests authenticate(Authenticator $authenticator)

Authenticate the request with an authenticator.

Parameters

Authenticator $authenticator

Return Value

AuthenticatesRequests

AuthenticatesRequests withToken(string $token, string $type = 'Bearer')

Authenticate the request with a token.

Parameters

string $token
string $type

Return Value

AuthenticatesRequests

AuthenticatesRequests withBasicAuth(string $username, string $password)

Authenticate the request with basic authentication.

Parameters

string $username
string $password

Return Value

AuthenticatesRequests

AuthenticatesRequests withDigestAuth(string $username, string $password)

Authenticate the request with digest authentication.

Parameters

string $username
string $password

Return Value

AuthenticatesRequests

in Bootable at line 14
void boot(PendingRequest $pendingRequest)

Configure a pending request for this resource.

Parameters

PendingRequest $pendingRequest

Return Value

void

in Conditionable at line 23
mixed when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in Conditionable at line 56
mixed unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in HandlesPsrRequest at line 15
RequestInterface handlePsrRequest(RequestInterface $request, PendingRequest $pendingRequest)

Handle the final PSR request before it is sent.

Parameters

RequestInterface $request
PendingRequest $pendingRequest

Return Value

RequestInterface

in HasBody at line 31
HasBody withBody(mixed $content, string|null $contentType = 'application/json')

Set the raw request body.

Parameters

mixed $content
string|null $contentType

Return Value

HasBody

in HasBody at line 50
HasBody asJson(array $data = [])

Use a JSON request body.

Parameters

array $data

Return Value

HasBody

in HasBody at line 63
HasBody asForm(array $data = [])

Use a URL-encoded form request body.

Parameters

array $data

Return Value

HasBody

in HasBody at line 75
HasBody asMultipart()

Use a multipart request body.

Return Value

HasBody

in HasBody at line 89
HasBody attach(string $name, mixed $contents = '', string|null $filename = null, array $headers = [])

Attach a multipart value to the request.

Parameters

string $name
mixed $contents
string|null $filename
array $headers

Return Value

HasBody

in HasBody at line 112
HasBody withData(array $data)

Merge structured values into the request body.

Parameters

array $data

Return Value

HasBody

in HasBody at line 129
mixed body()

Get the resolved request body value.

Return Value

mixed

in HasBody at line 137
bool hasBody()

Determine if the request has a body repository.

Return Value

bool

in HasBody at line 147
final BodyRepository|null copyBodyRepository()

internal  
 

Copy the body repository for a pending request.

Return Value

BodyRepository|null

in HasBody at line 157
protected BodyRepository|null defaultBodyRepository()

Resolve the default body repository.

Return Value

BodyRepository|null

in HasBody at line 165
protected BodyRepository|null bodyRepository()

Get the request body repository.

Return Value

BodyRepository|null

in HasCustomResponses at line 23
string|null resolveResponseClass(Response $response)

Resolve the custom response class.

Parameters

Response $response

Return Value

string|null

in HasDebugging at line 22
HasDebugging debugRequest(callable|null $onRequest = null, bool $die = false)

Debug the final application-owned request.

Parameters

callable|null $onRequest
bool $die

Return Value

HasDebugging

in HasDebugging at line 50
HasDebugging debugResponse(callable|null $onResponse = null, bool $die = false)

Debug the response before ordinary response middleware.

Parameters

callable|null $onResponse
bool $die

Return Value

HasDebugging

in HasDebugging at line 81
HasDebugging debug(bool $die = false)

Debug both the request and response.

Raw debugging output may contain credentials or other sensitive values.

Parameters

bool $die

Return Value

HasDebugging

in HasMockClient at line 21
HasMockClient withMockClient(MockClient $mockClient)

Use a mock client for this request.

Parameters

MockClient $mockClient

Return Value

HasMockClient

in HasMockClient at line 31
MockClient|null mockClient()

Get the mock client.

Return Value

MockClient|null

in HasMockClient at line 39
bool hasMockClient()

Determine if the request has a mock client.

Return Value

bool

in HasCookies at line 25
HasCookies withCookie(SetCookie $cookie)

Specify a cookie and its attributes for the request.

Parameters

SetCookie $cookie

Return Value

HasCookies

in HasCookies at line 46
HasCookies withCookies(array $cookies, string $domain)

Specify cookies that should be included with the request.

Parameters

array $cookies
string $domain

Return Value

HasCookies

in HasCookies at line 60
array cookies()

Get the request cookies and their attributes.

Return Value

array

in HasDelay at line 22
HasDelay delay(int $milliseconds)

Delay the request by the given milliseconds.

Parameters

int $milliseconds

Return Value

HasDelay

in HasDelay at line 36
int|null delayMilliseconds()

Get the request delay in milliseconds.

Return Value

int|null

in HasDelay at line 44
protected int|null defaultDelay()

Resolve the default request delay.

Return Value

int|null

in HasDelay at line 52
protected IntegerRepository delayRepository()

Get the request delay repository.

Return Value

IntegerRepository

in HasHeaders at line 21
array headers()

Get the request headers.

Return Value

array

in HasHeaders at line 29
bool hasHeader(string $name)

Determine if the request contains the given header.

Parameters

string $name

Return Value

bool

in HasHeaders at line 46
HasHeaders withHeaders(array $headers)

Add headers to the request.

Parameters

array $headers

Return Value

HasHeaders

in HasHeaders at line 58
HasHeaders withHeader(string $name, mixed $value)

Add a header to the request.

Parameters

string $name
mixed $value

Return Value

HasHeaders

in HasHeaders at line 69
HasHeaders replaceHeaders(array $headers)

Replace matching headers on the request.

Parameters

array $headers

Return Value

HasHeaders

in HasHeaders at line 97
HasHeaders contentType(string $contentType)

Specify the request content type.

Parameters

string $contentType

Return Value

HasHeaders

in HasHeaders at line 107
HasHeaders acceptJson()

Indicate that JSON should be returned by the server.

Return Value

HasHeaders

in HasHeaders at line 117
HasHeaders accept(string $contentType)

Indicate the type of content that should be returned by the server.

Parameters

string $contentType

Return Value

HasHeaders

in HasHeaders at line 127
HasHeaders withUserAgent(bool|string $userAgent)

Specify the request user agent.

Parameters

bool|string $userAgent

Return Value

HasHeaders

in HasHeaders at line 137
protected array defaultHeaders()

Resolve the default request headers.

Return Value

array

in HasHeaders at line 145
protected ArrayRepository headerRepository()

Get the request header repository.

Return Value

ArrayRepository

in HasMiddleware at line 19
MiddlewarePipeline middleware()

Get the request middleware pipeline.

Return Value

MiddlewarePipeline

in HasOptions at line 23
array options()

Get the request options.

Return Value

array

in HasOptions at line 34
HasOptions withOptions(array $options)

Add options to the request.

Parameters

array $options

Return Value

HasOptions

in HasOptions at line 46
HasOptions maxRedirects(int $max)

Specify the maximum number of redirects to allow.

Parameters

int $max

Return Value

HasOptions

in HasOptions at line 64
HasOptions withoutRedirecting()

Indicate that redirects should not be followed.

Return Value

HasOptions

in HasOptions at line 74
HasOptions withoutVerifying()

Indicate that TLS certificates should not be verified.

Return Value

HasOptions

in HasOptions at line 85
HasOptions sink(resource|StreamInterface|string $to)

Specify where the response body should be stored.

Parameters

resource|StreamInterface|string $to

Return Value

HasOptions

in HasOptions at line 95
HasOptions timeout(float|int $seconds)

Specify the request timeout in seconds.

Parameters

float|int $seconds

Return Value

HasOptions

in HasOptions at line 105
HasOptions connectTimeout(float|int $seconds)

Specify the connection timeout in seconds.

Parameters

float|int $seconds

Return Value

HasOptions

in HasOptions at line 116
HasOptions withTelescopeTags(array $tags)

Add Telescope tags to the request.

Parameters

array $tags

Return Value

HasOptions

in HasOptions at line 126
HasOptions withoutTelescope()

Disable Telescope recording for the request.

Return Value

HasOptions

in HasOptions at line 136
protected array defaultOptions()

Resolve the default request options.

Return Value

array

in HasOptions at line 144
protected ArrayRepository optionRepository()

Get the request option repository.

Return Value

ArrayRepository

in HasQuery at line 24
string|null queryString()

Get the raw query string override, without a leading question mark.

Return Value

string|null

in HasQuery at line 32
HasQuery withQueryString(string $query)

Replace the base URL and endpoint query string.

Parameters

string $query

Return Value

HasQuery

in HasQuery at line 44
array queryParameters()

Get the request query parameters.

Return Value

array

in HasQuery at line 55
HasQuery withQueryParameters(array $parameters)

Add query parameters to the request.

Parameters

array $parameters

Return Value

HasQuery

in HasQuery at line 67
protected array defaultQuery()

Resolve the default request query parameters.

Return Value

array

in HasQuery at line 75
protected string|null defaultQueryString()

Resolve the default raw query string override.

Return Value

string|null

in HasQuery at line 83
protected ArrayRepository queryRepository()

Get the request query repository.

Return Value

ArrayRepository

in HasRetryPolicy at line 23
HasRetryPolicy retry(array|int $times, Closure|int $sleepMilliseconds = 0, callable|null $when = null, bool $throw = true)

Specify the number of times the request should be attempted.

Parameters

array|int $times
Closure|int $sleepMilliseconds
callable|null $when
bool $throw

Return Value

HasRetryPolicy

in HasRetryPolicy at line 37
RetryPolicy retryPolicy()

Get the request retry policy.

Return Value

RetryPolicy

in Macroable at line 28
static void macro(string $name, callable|object $macro)

Register a custom macro.

Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.

Parameters

string $name
callable|object $macro

Return Value

void

in Macroable at line 41
static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

in Macroable at line 57
static bool hasMacro(string $name)

Check if macro is registered.

Parameters

string $name

Return Value

bool

in Macroable at line 68
static void flushMacros()

Flush the existing macros.

Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.

Return Value

void

in Macroable at line 78
static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in Macroable at line 103
mixed __call(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in Makeable at line 12
static Makeable make(mixed ...$arguments)

Create a new instance with the given arguments.

Parameters

mixed ...$arguments

Return Value

Makeable

in ManagesExceptions at line 15
bool|null hasRequestFailed(Response $response)

Determine if the request failed.

Parameters

Response $response

Return Value

bool|null

in ManagesExceptions at line 23
RequestException|null getRequestException(Response $response)

Resolve the request exception.

Parameters

Response $response

Return Value

RequestException|null

in ManagesExceptions at line 31
bool shouldThrowRequestException(Response $response)

Determine if the response should throw a request exception.

Parameters

Response $response

Return Value

bool

in Request at line 58
static static newInstance()

Create a fresh request for container resolution.

Return Value

static

in Request at line 66
Method method()

Get the HTTP method used by the request.

Return Value

Method

at line 31
string resolveEndpoint()

Resolve the user endpoint.

Return Value

string

in Request at line 83
string|null url()

Get the absolute URL override.

Return Value

string|null

in Request at line 91
Request withUrl(string $url)

Replace the connector base URL and request endpoint.

Parameters

string $url

Return Value

Request

at line 39
bool|null allowsBaseUrlOverride()

Resolve whether the trusted OAuth endpoint may replace the connector base URL.

Return Value

bool|null

in Request at line 111
bool usesCachingControls()

internal  
 

Determine if this request defines cache controls.

Return Value

bool

in Request at line 119
bool cachingEnabled()

Determine if caching is enabled for this request.

Return Value

bool

in Request at line 129
bool shouldInvalidateCache()

internal  
 

Determine if the matching cache entry should be invalidated.

Return Value

bool

in Request at line 139
string|null resolveCacheKey(PendingRequest $pendingRequest)

internal  
 

Resolve the request's custom cache key.

Parameters

PendingRequest $pendingRequest

Return Value

string|null

in Request at line 150
array|null resolveCacheableMethods()

internal  
 

Resolve the request's cacheable HTTP methods.

Return Value

array|null

in Request at line 160
bool usesRateLimits()

internal  
 

Determine if this request defines rate limits.

Return Value

bool

in Request at line 171
array resolveRateLimitPolicies(PendingRequest $pendingRequest)

internal  
 

Resolve the request's admission policies.

Parameters

PendingRequest $pendingRequest

Return Value

array

in Request at line 181
UnitEnum|string|null resolveRateLimitStoreName()

internal  
 

Resolve the request's rate limiter store.

Return Value

UnitEnum|string|null

in Request at line 191
bool shouldWaitForRateLimits()

internal  
 

Determine if request rate limits should be awaited.

Return Value

bool

in Request at line 201
string resolveRateLimitCooldownKeyFor(PendingRequest $pendingRequest)

internal  
 

Resolve the request's stable cooldown key.

Parameters

PendingRequest $pendingRequest

Return Value

string

in Request at line 211
int|null resolveRateLimitCooldownFor(Response $response)

internal  
 

Resolve the request cooldown imposed by a response.

Parameters

Response $response

Return Value

int|null

in Request at line 219
void __clone()

Clone the request's initialized mutable state.

Return Value

void

in Request at line 232
static void flushState()

Flush all static state.

Return Value

void

in AcceptsJson at line 14
void bootAcceptsJson(PendingRequest $pendingRequest)

Apply the JSON response preference.

Parameters

PendingRequest $pendingRequest

Return Value

void

at line 24
__construct(OAuthConfig $oauthConfig)

Create an OAuth user request.

Parameters

OAuthConfig $oauthConfig