Class StitchAuthRequest.Builder
- java.lang.Object
-
- com.mongodb.stitch.core.internal.net.StitchRequest.Builder
-
- com.mongodb.stitch.core.internal.net.StitchAuthRequest.Builder
-
- Direct Known Subclasses:
StitchAuthDocRequest.Builder
- Enclosing class:
- StitchAuthRequest
public static class StitchAuthRequest.Builder extends StitchRequest.Builder
A builder that can buildStitchAuthRequest
s.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructs a new builder.
-
Method Summary
Modifier and Type Method Description StitchAuthRequest
build()
Builds the request.StitchAuthRequest.Builder
withAccessToken()
Set if this request should use an access token in this request.StitchAuthRequest.Builder
withBody(byte[] body)
Sets a copy of the body that will be sent along with the request.StitchAuthRequest.Builder
withHeaders(Map<String,String> headers)
Sets the headers that will be included in the request.StitchAuthRequest.Builder
withMethod(Method method)
Sets the HTTP method of the request.StitchAuthRequest.Builder
withPath(String path)
Sets the Stitch API path of the request.StitchAuthRequest.Builder
withRefreshToken()
Set if this request should use a refresh token in this request.StitchAuthRequest.Builder
withShouldRefreshOnFailure(boolean shouldRefresh)
Sets whether or not the performer of this request should attempt to refresh authentication info on failure.-
Methods inherited from class com.mongodb.stitch.core.internal.net.StitchRequest.Builder
getBody, getHeaders, getMethod, getPath, getTimeout, withTimeout
-
-
-
-
Method Detail
-
withAccessToken
public StitchAuthRequest.Builder withAccessToken()
Set if this request should use an access token in this request.- Returns:
- the builder.
-
withRefreshToken
public StitchAuthRequest.Builder withRefreshToken()
Set if this request should use a refresh token in this request.- Returns:
- the builder.
-
withShouldRefreshOnFailure
public StitchAuthRequest.Builder withShouldRefreshOnFailure(boolean shouldRefresh)
Sets whether or not the performer of this request should attempt to refresh authentication info on failure.- Parameters:
shouldRefresh
- whether or not the performer of this request should attempt to refresh authentication info on failure.- Returns:
- the builder.
-
withMethod
public StitchAuthRequest.Builder withMethod(Method method)
Sets the HTTP method of the request.- Overrides:
withMethod
in classStitchRequest.Builder
- Parameters:
method
- the HTTP method of the request.- Returns:
- the builder.
-
withPath
public StitchAuthRequest.Builder withPath(String path)
Sets the Stitch API path of the request.- Overrides:
withPath
in classStitchRequest.Builder
- Parameters:
path
- the Stitch API path of the request.- Returns:
- the builder.
-
withHeaders
public StitchAuthRequest.Builder withHeaders(Map<String,String> headers)
Sets the headers that will be included in the request.- Overrides:
withHeaders
in classStitchRequest.Builder
- Parameters:
headers
- the headers that will be included in the request.- Returns:
- the builder.
-
withBody
public StitchAuthRequest.Builder withBody(byte[] body)
Sets a copy of the body that will be sent along with the request.- Overrides:
withBody
in classStitchRequest.Builder
- Parameters:
body
- a copy of the body that will be sent along with the request.- Returns:
- the builder.
-
build
public StitchAuthRequest build()
Builds the request.- Overrides:
build
in classStitchRequest.Builder
- Returns:
- the built
StitchAuthRequest
.
-
-