當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。