本文整理汇总了Java中com.amazonaws.services.apigateway.model.PutMethodRequest类的典型用法代码示例。如果您正苦于以下问题:Java PutMethodRequest类的具体用法?Java PutMethodRequest怎么用?Java PutMethodRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PutMethodRequest类属于com.amazonaws.services.apigateway.model包,在下文中一共展示了PutMethodRequest类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPostMethod
import com.amazonaws.services.apigateway.model.PutMethodRequest; //导入依赖的package包/类
private void createPostMethod(final CreateRestApiResult createApiResult, final CreateResourceResult crrs) {
final PutMethodRequest pmrq = new PutMethodRequest().withHttpMethod("POST")
.withRestApiId(createApiResult.getId())
.withResourceId(crrs.getId())
.withAuthorizationType("NONE");
this.awsApiClient.putMethod(pmrq);
}
示例2: createMethod
import com.amazonaws.services.apigateway.model.PutMethodRequest; //导入依赖的package包/类
private void createMethod(final CreateRestApiResult createApiResult, final CreateResourceResult crrs,
final String iarn) {
final HashMap<String, Boolean> params = new HashMap<>();
params.put("method.request.querystring.code", true);
params.put("method.request.querystring.state", false);
final PutMethodRequest pmrq = new PutMethodRequest().withRestApiId(createApiResult.getId())
.withResourceId(crrs.getId())
.withHttpMethod(HttpMethod)
.withRequestParameters(params)
.withAuthorizationType("NONE");
this.awsApiClient.putMethod(pmrq);
final String tplt = "{\"code\":\"$input.params('code')\",\"state\":\"$input.params('state')\"}";
final PutIntegrationRequest pirq = new PutIntegrationRequest().withType(IntegrationType.AWS)
.withRestApiId(createApiResult.getId())
.withResourceId(crrs.getId())
.withHttpMethod(HttpMethod)
.withIntegrationHttpMethod("POST")
.withPassthroughBehavior("NEVER")
.withRequestTemplates(Collections.singletonMap("application/json", tplt))
.withUri(iarn);
this.awsApiClient.putIntegration(pirq);
final PutMethodResponseRequest pmrsrq = new PutMethodResponseRequest().withRestApiId(createApiResult.getId())
.withResourceId(crrs.getId())
.withHttpMethod(HttpMethod)
.withStatusCode("302")
.withResponseParameters(Collections.singletonMap("method.response.header.Location", true))
.withResponseModels(Collections.emptyMap());
this.awsApiClient.putMethodResponse(pmrsrq);
final PutIntegrationResponseRequest pirsrq = new PutIntegrationResponseRequest()
.withRestApiId(createApiResult.getId())
.withResourceId(crrs.getId())
.withHttpMethod(HttpMethod)
.withStatusCode("302")
.withResponseParameters(Collections.singletonMap("method.response.header.Location",
"'http://translate.banjocreek.io/thankyou.html'"))
.withResponseTemplates(Collections.emptyMap());
this.awsApiClient.putIntegrationResponse(pirsrq);
}