当前位置: 首页>>代码示例>>Java>>正文


Java PutIntegrationRequest类代码示例

本文整理汇总了Java中com.amazonaws.services.apigateway.model.PutIntegrationRequest的典型用法代码示例。如果您正苦于以下问题:Java PutIntegrationRequest类的具体用法?Java PutIntegrationRequest怎么用?Java PutIntegrationRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PutIntegrationRequest类属于com.amazonaws.services.apigateway.model包,在下文中一共展示了PutIntegrationRequest类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: integratePostMethod

import com.amazonaws.services.apigateway.model.PutIntegrationRequest; //导入依赖的package包/类
private void integratePostMethod(final CreateRestApiResult createApiResult, final CreateResourceResult crrs,
        final String iarn) {
    final PutIntegrationRequest pirq = new PutIntegrationRequest().withType(IntegrationType.AWS)
            .withRestApiId(createApiResult.getId())
            .withResourceId(crrs.getId())
            .withHttpMethod("POST")
            .withIntegrationHttpMethod("POST")
            .withUri(iarn)
            .withPassthroughBehavior("WHEN_NO_TEMPLATES")
            .withRequestTemplates(Collections.emptyMap());
    this.awsApiClient.putIntegration(pirq);

    final PutIntegrationResponseRequest pirsrq = new PutIntegrationResponseRequest()
            .withRestApiId(createApiResult.getId())
            .withResourceId(crrs.getId())
            .withHttpMethod("POST")
            .withStatusCode("200")
            .withResponseTemplates(Collections.singletonMap("application/json", ""));
    this.awsApiClient.putIntegrationResponse(pirsrq);

    final PutMethodResponseRequest pmrsrq = new PutMethodResponseRequest().withRestApiId(createApiResult.getId())
            .withResourceId(crrs.getId())
            .withHttpMethod("POST")
            .withStatusCode("200")
            .withResponseModels(Collections.singletonMap("application/json", "Empty"));
    this.awsApiClient.putMethodResponse(pmrsrq);
}
 
开发者ID:aztecrex,项目名称:java-translatebot,代码行数:28,代码来源:EventHandlerDeployer.java

示例2: integratePostMethod

import com.amazonaws.services.apigateway.model.PutIntegrationRequest; //导入依赖的package包/类
private void integratePostMethod(final CreateRestApiResult createApiResult, final CreateResourceResult crrs,
        final String iarn) {
    final String template = loadTemplate();
    final PutIntegrationRequest pirq = new PutIntegrationRequest().withType(IntegrationType.AWS)
            .withRestApiId(createApiResult.getId())
            .withResourceId(crrs.getId())
            .withHttpMethod("POST")
            .withIntegrationHttpMethod("POST")
            .withUri(iarn)
            .withPassthroughBehavior("WHEN_NO_TEMPLATES")
            .withRequestTemplates(Collections.singletonMap("application/x-www-form-urlencoded", template));
    this.awsApiClient.putIntegration(pirq);

    final PutIntegrationResponseRequest pirsrq = new PutIntegrationResponseRequest()
            .withRestApiId(createApiResult.getId())
            .withResourceId(crrs.getId())
            .withHttpMethod("POST")
            .withStatusCode("200")
            .withResponseTemplates(Collections.singletonMap("application/json", ""));
    this.awsApiClient.putIntegrationResponse(pirsrq);

    final PutMethodResponseRequest pmrsrq = new PutMethodResponseRequest().withRestApiId(createApiResult.getId())
            .withResourceId(crrs.getId())
            .withHttpMethod("POST")
            .withStatusCode("200")
            .withResponseModels(Collections.singletonMap("application/json", "Empty"));
    this.awsApiClient.putMethodResponse(pmrsrq);
}
 
开发者ID:aztecrex,项目名称:java-translatebot,代码行数:29,代码来源:CommandHandlerDeployer.java

示例3: createMethod

import com.amazonaws.services.apigateway.model.PutIntegrationRequest; //导入依赖的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);

}
 
开发者ID:aztecrex,项目名称:java-translatebot,代码行数:43,代码来源:OauthHandlerDeployer.java


注:本文中的com.amazonaws.services.apigateway.model.PutIntegrationRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。