Class StitchAuthDocRequest.Builder
- java.lang.Object
-
- com.mongodb.stitch.core.internal.net.StitchRequest.Builder
-
- com.mongodb.stitch.core.internal.net.StitchAuthRequest.Builder
-
- com.mongodb.stitch.core.internal.net.StitchAuthDocRequest.Builder
-
- Enclosing class:
- StitchAuthDocRequest
public static class StitchAuthDocRequest.Builder extends StitchAuthRequest.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructs a new builder.
-
Method Summary
Modifier and Type Method Description StitchAuthDocRequest
build()
Builds theStitchAuthDocRequest
.StitchAuthDocRequest
build(CodecRegistry codecRegistry)
Builds theStitchAuthDocRequest
using the given codec registry for encoding the document.Document
getDocument()
Returns the document to send in the request.StitchAuthDocRequest.Builder
withAccessToken()
Set if this request should use an access token in this request.StitchAuthDocRequest.Builder
withBody(byte[] body)
Sets a copy of the body that will be sent along with the request.StitchAuthDocRequest.Builder
withDocument(Document document)
Sets the document to send in the request.StitchAuthDocRequest.Builder
withHeaders(Map<String,String> headers)
Sets the headers that will be included in the request.StitchAuthDocRequest.Builder
withMethod(Method method)
Sets the HTTP method of the request.StitchAuthDocRequest.Builder
withPath(String path)
Sets the Stitch API path of the request.StitchAuthDocRequest.Builder
withRefreshToken()
Set if this request should use a refresh token in this request.StitchAuthDocRequest.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
-
withDocument
public StitchAuthDocRequest.Builder withDocument(Document document)
Sets the document to send in the request.- Parameters:
document
- the document to send in the request.- Returns:
- the builder.
-
getDocument
public Document getDocument()
Returns the document to send in the request.- Returns:
- the document to send in the request.
-
withAccessToken
public StitchAuthDocRequest.Builder withAccessToken()
Set if this request should use an access token in this request.- Overrides:
withAccessToken
in classStitchAuthRequest.Builder
- Returns:
- the builder.
-
withRefreshToken
public StitchAuthDocRequest.Builder withRefreshToken()
Set if this request should use a refresh token in this request.- Overrides:
withRefreshToken
in classStitchAuthRequest.Builder
- Returns:
- the builder.
-
withShouldRefreshOnFailure
public StitchAuthDocRequest.Builder withShouldRefreshOnFailure(boolean shouldRefresh)
Sets whether or not the performer of this request should attempt to refresh authentication info on failure.- Overrides:
withShouldRefreshOnFailure
in classStitchAuthRequest.Builder
- Parameters:
shouldRefresh
- whether or not the performer of this request should attempt to refresh authentication info on failure.- Returns:
- the builder.
-
withMethod
public StitchAuthDocRequest.Builder withMethod(Method method)
Sets the HTTP method of the request.- Overrides:
withMethod
in classStitchAuthRequest.Builder
- Parameters:
method
- the HTTP method of the request.- Returns:
- the builder.
-
withPath
public StitchAuthDocRequest.Builder withPath(String path)
Sets the Stitch API path of the request.- Overrides:
withPath
in classStitchAuthRequest.Builder
- Parameters:
path
- the Stitch API path of the request.- Returns:
- the builder.
-
withHeaders
public StitchAuthDocRequest.Builder withHeaders(Map<String,String> headers)
Sets the headers that will be included in the request.- Overrides:
withHeaders
in classStitchAuthRequest.Builder
- Parameters:
headers
- the headers that will be included in the request.- Returns:
- the builder.
-
withBody
public StitchAuthDocRequest.Builder withBody(byte[] body)
Sets a copy of the body that will be sent along with the request.- Overrides:
withBody
in classStitchAuthRequest.Builder
- Parameters:
body
- a copy of the body that will be sent along with the request.- Returns:
- the builder.
-
build
public StitchAuthDocRequest build()
Builds theStitchAuthDocRequest
.- Overrides:
build
in classStitchAuthRequest.Builder
- Returns:
- the built
StitchAuthDocRequest
.
-
build
public StitchAuthDocRequest build(CodecRegistry codecRegistry)
Builds theStitchAuthDocRequest
using the given codec registry for encoding the document.- Parameters:
codecRegistry
- the registry to use for encoding the document.- Returns:
- the built
StitchAuthDocRequest
.
-
-