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 buildStitchAuthRequests.
-
-
Constructor Summary
Constructors Constructor Description Builder()Constructs a new builder.
-
Method Summary
Modifier and Type Method Description StitchAuthRequestbuild()Builds the request.StitchAuthRequest.BuilderwithAccessToken()Set if this request should use an access token in this request.StitchAuthRequest.BuilderwithBody(byte[] body)Sets a copy of the body that will be sent along with the request.StitchAuthRequest.BuilderwithHeaders(Map<String,String> headers)Sets the headers that will be included in the request.StitchAuthRequest.BuilderwithMethod(Method method)Sets the HTTP method of the request.StitchAuthRequest.BuilderwithPath(String path)Sets the Stitch API path of the request.StitchAuthRequest.BuilderwithRefreshToken()Set if this request should use a refresh token in this request.StitchAuthRequest.BuilderwithShouldRefreshOnFailure(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:
withMethodin 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:
withPathin 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:
withHeadersin 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:
withBodyin 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:
buildin classStitchRequest.Builder- Returns:
- the built
StitchAuthRequest.
-
-