public class SwaggerMethodParser extends Object
| Modifier and Type | Method and Description |
|---|---|
Object |
body(Object[] swaggerMethodArguments)
Get the object to be used as the body of the HTTP request.
|
String |
bodyContentType() |
Type |
bodyJavaType()
Get the type of the body parameter to this method, if present.
|
Context |
context(Object[] swaggerMethodArguments)
Get the
Context passed into the proxy method. |
Iterable<com.microsoft.rest.v2.EncodedParameter> |
encodedQueryParameters(Object[] swaggerMethodArguments)
Get the encoded query parameters that have been added to this value based on the provided
method arguments.
|
Class<?> |
exceptionBodyType()
Get the type of body Object that a thrown RestException will contain if the HTTP response's
status code is not one of the expected status codes.
|
Class<? extends RestException> |
exceptionType()
Get the type of RestException that will be thrown if the HTTP response's status code is not
one of the expected status codes.
|
int[] |
expectedStatusCodes()
Get the HTTP response status codes that are expected when a request is sent out for this
Swagger method.
|
boolean |
expectsResponseBody() |
String |
fullyQualifiedMethodName()
Get the fully qualified method that was called to invoke this HTTP request.
|
Iterable<HttpHeader> |
headers(Object[] swaggerMethodArguments)
Get the headers that have been added to this value based on the provided method arguments.
|
String |
host(Object[] swaggerMethodArguments)
Get the host to use for HTTP requests for this Swagger method.
|
HttpMethod |
httpMethod()
Get the HTTP method that will be used to complete the Swagger method's request.
|
boolean |
isExpectedResponseStatusCode(int responseStatusCode)
Get whether or not the provided response status code is one of the expected status codes for
this Swagger method.
|
boolean |
isExpectedResponseStatusCode(int responseStatusCode,
int[] additionalAllowedStatusCodes)
Get whether or not the provided response status code is one of the expected status codes for
this Swagger method.
|
String |
path(Object[] methodArguments)
Get the path that will be used to complete the Swagger method's request.
|
Type |
returnType()
Get the return type for the method that this object describes.
|
Type |
returnValueWireType()
Get the type that the return value will be send across the network as.
|
String |
scheme(Object[] swaggerMethodArguments)
Get the scheme to use for HTTP requests for this Swagger method.
|
public String fullyQualifiedMethodName()
public HttpMethod httpMethod()
public int[] expectedStatusCodes()
public String scheme(Object[] swaggerMethodArguments)
swaggerMethodArguments - The arguments to use for scheme/host substitutions.public String host(Object[] swaggerMethodArguments)
swaggerMethodArguments - The arguments to use for host substitutions.public String path(Object[] methodArguments)
methodArguments - The method arguments to use with the path substitutions.public Iterable<com.microsoft.rest.v2.EncodedParameter> encodedQueryParameters(Object[] swaggerMethodArguments)
swaggerMethodArguments - The arguments that will be used to create the query parameters'
values.public Iterable<HttpHeader> headers(Object[] swaggerMethodArguments)
swaggerMethodArguments - The arguments that will be used to create the headers' values.public Context context(Object[] swaggerMethodArguments)
Context passed into the proxy method.swaggerMethodArguments - the arguments passed to the proxy methodpublic boolean isExpectedResponseStatusCode(int responseStatusCode)
responseStatusCode - The status code that was returned in the HTTP response.public boolean isExpectedResponseStatusCode(int responseStatusCode,
int[] additionalAllowedStatusCodes)
responseStatusCode - The status code that was returned in the HTTP response.additionalAllowedStatusCodes - An additional set of allowed status codes that will be
merged with the existing set of allowed status codes for
this query.public Class<? extends RestException> exceptionType()
public Class<?> exceptionBodyType()
public Object body(Object[] swaggerMethodArguments)
swaggerMethodArguments - The method arguments to get the body object from.public String bodyContentType()
public Type returnType()
public Type bodyJavaType()
public Type returnValueWireType()
public boolean expectsResponseBody()
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/