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 StitchAuthDocRequestbuild()Builds theStitchAuthDocRequest.StitchAuthDocRequestbuild(CodecRegistry codecRegistry)Builds theStitchAuthDocRequestusing the given codec registry for encoding the document.DocumentgetDocument()Returns the document to send in the request.StitchAuthDocRequest.BuilderwithAccessToken()Set if this request should use an access token in this request.StitchAuthDocRequest.BuilderwithBody(byte[] body)Sets a copy of the body that will be sent along with the request.StitchAuthDocRequest.BuilderwithDocument(Document document)Sets the document to send in the request.StitchAuthDocRequest.BuilderwithHeaders(Map<String,String> headers)Sets the headers that will be included in the request.StitchAuthDocRequest.BuilderwithMethod(Method method)Sets the HTTP method of the request.StitchAuthDocRequest.BuilderwithPath(String path)Sets the Stitch API path of the request.StitchAuthDocRequest.BuilderwithRefreshToken()Set if this request should use a refresh token in this request.StitchAuthDocRequest.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
-
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:
withAccessTokenin classStitchAuthRequest.Builder- Returns:
- the builder.
-
withRefreshToken
public StitchAuthDocRequest.Builder withRefreshToken()
Set if this request should use a refresh token in this request.- Overrides:
withRefreshTokenin 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:
withShouldRefreshOnFailurein 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:
withMethodin 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:
withPathin 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:
withHeadersin 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:
withBodyin 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:
buildin classStitchAuthRequest.Builder- Returns:
- the built
StitchAuthDocRequest.
-
build
public StitchAuthDocRequest build(CodecRegistry codecRegistry)
Builds theStitchAuthDocRequestusing the given codec registry for encoding the document.- Parameters:
codecRegistry- the registry to use for encoding the document.- Returns:
- the built
StitchAuthDocRequest.
-
-