• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java GetPlatformApplicationAttributesRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: verifyPlatformApplication

import com.amazonaws.services.sns.model.GetPlatformApplicationAttributesRequest; //导入依赖的package包/类
public void verifyPlatformApplication(AmazonSNS client) {
    try {
        if (!BatchCreatePlatformEndpointSample.listOfRegions
                .contains(this.region = this.applicationArn.split(":")[3])) {
            System.err.println("[ERROR] The region " + region
                    + " is invalid");
            System.exit(BatchCreatePlatformEndpointSample.MALFORMED_PROPERTIES_ERROR_CODE);
        }
    } catch (ArrayIndexOutOfBoundsException aioobe) {
        System.err.println("[ERROR] The ARN " + this.applicationArn
                + " is malformed");
        System.exit(BatchCreatePlatformEndpointSample.MALFORMED_PROPERTIES_ERROR_CODE);
    }
    client.setEndpoint("https://sns." + this.region + ".amazonaws.com/");
    try {
        GetPlatformApplicationAttributesRequest applicationAttributesRequest = new GetPlatformApplicationAttributesRequest();
        applicationAttributesRequest
                .setPlatformApplicationArn(this.applicationArn);
        @SuppressWarnings("unused")
        GetPlatformApplicationAttributesResult getAttributesResult = client
                .getPlatformApplicationAttributes(applicationAttributesRequest);
    } catch (NotFoundException nfe) {
        System.err
                .println("[ERROR: APP NOT FOUND] The application ARN provided: "
                        + this.applicationArn
                        + " does not correspond to any existing platform applications. "
                        + nfe.getMessage());
        System.exit(BatchCreatePlatformEndpointSample.NOT_FOUND_ERROR_CODE);
    } catch (InvalidParameterException ipe) {
        System.err
                .println("[ERROR: APP ARN INVALID] The application ARN provided: "
                        + this.applicationArn
                        + " is malformed"
                        + ipe.getMessage());
        System.exit(BatchCreatePlatformEndpointSample.NOT_FOUND_ERROR_CODE);
    }
}
 
开发者ID:tonchidot,项目名称:aws-java-sns-mobile-push-sample,代码行数:38,代码来源:CreateEndpointJob.java


示例2: testNonInjectableMocks_shouldReturnNormal

import com.amazonaws.services.sns.model.GetPlatformApplicationAttributesRequest; //导入依赖的package包/类
@Test
public void testNonInjectableMocks_shouldReturnNormal() {
  mockSns(new MockParameters());
  
  CheckIfPhoneNumberIsOptedOutRequest phoneRequest = new CheckIfPhoneNumberIsOptedOutRequest()
      .withPhoneNumber("555123456");
  CheckIfPhoneNumberIsOptedOutResult phoneResult = sns.checkIfPhoneNumberIsOptedOut(phoneRequest);
  assertNotNull(phoneResult);
  
  CreatePlatformApplicationRequest createPlatformRequest = new CreatePlatformApplicationRequest()
      .withAttributes(ImmutableMap.of("os","oreo"))
      .withName("android").withPlatform("mobile");
  assertNotNull(sns.createPlatformApplication(createPlatformRequest));
  
  CreatePlatformEndpointRequest createPlatformEndpointReq = new CreatePlatformEndpointRequest()
      .withAttributes(ImmutableMap.of("os","lollypop"))
      .withCustomUserData("something custom")
      .withPlatformApplicationArn("mobile")
      .withToken("5-euro-token");
  assertNotNull(sns.createPlatformEndpoint(createPlatformEndpointReq));
  
  DeleteEndpointRequest deleteEndpointReq = new DeleteEndpointRequest()
      .withEndpointArn("arn:aws:sms:us-east-1:123456789012:myc:02034b43-fefa-4e07-a5e");
  assertNotNull(sns.deleteEndpoint(deleteEndpointReq));
  
  DeletePlatformApplicationRequest delPlatformAppReq = new DeletePlatformApplicationRequest()
      .withPlatformApplicationArn("arn:aws:sms:us-east-1:123456789012:myc:02034b43-fefa-4e07-a5e");
  assertNotNull(sns.deletePlatformApplication(delPlatformAppReq));
      
  GetEndpointAttributesRequest getEndpointAttr = new GetEndpointAttributesRequest();
  assertNotNull(sns.getEndpointAttributes(getEndpointAttr));
  
  assertNotNull(sns.getPlatformApplicationAttributes(
      new GetPlatformApplicationAttributesRequest().withPlatformApplicationArn("some-arn")));
  
  assertNotNull(sns.getSMSAttributes(new GetSMSAttributesRequest().withAttributes("attr1","attr2")));
  
  assertNotNull(sns.listEndpointsByPlatformApplication(new ListEndpointsByPlatformApplicationRequest()
      .withNextToken("0-euro-token").withPlatformApplicationArn("cheap-arn")));
  
  assertNotNull(sns.listPhoneNumbersOptedOut(new ListPhoneNumbersOptedOutRequest().withNextToken("plastic-token")));
  
  assertNotNull(sns.listPlatformApplications(new ListPlatformApplicationsRequest().withNextToken("wooden-token")));
  
  assertNotNull(sns.listPlatformApplications());
  
  assertNotNull(sns.optInPhoneNumber(new OptInPhoneNumberRequest().withPhoneNumber("123456789")));
  
  assertNotNull(sns.setEndpointAttributes(new SetEndpointAttributesRequest().withEndpointArn("at the end of the world")
      .withAttributes(ImmutableMap.of("some-prop","some-value"))));
  
  assertNotNull(sns.setPlatformApplicationAttributes(new SetPlatformApplicationAttributesRequest().withPlatformApplicationArn("arnn:::")
      .withAttributes(ImmutableMap.of("super","mario"))));
  
  assertNotNull(sns.setSMSAttributes(new SetSMSAttributesRequest().withAttributes(ImmutableMap.of("wtf","mfg"))));
  
  assertNotNull(sns.removePermission(new RemovePermissionRequest().withLabel("fashion label").withTopicArn("fancy topic")));
}
 
开发者ID:daflockinger,项目名称:unitstack,代码行数:59,代码来源:MockSnsTest.java


示例3: load

import com.amazonaws.services.sns.model.GetPlatformApplicationAttributesRequest; //导入依赖的package包/类
@Override
public boolean load(GetPlatformApplicationAttributesRequest request) {
    return load(request, null);
}
 
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:5,代码来源:PlatformApplicationImpl.java


示例4: load

import com.amazonaws.services.sns.model.GetPlatformApplicationAttributesRequest; //导入依赖的package包/类
/**
 * Makes a call to the service to load this resource's attributes if they
 * are not loaded yet.
 * The following request parameters will be populated from the data of this
 * <code>PlatformApplication</code> resource, and any conflicting parameter
 * value set in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>PlatformApplicationArn</code></b>
 *         - mapped from the <code>Arn</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return Returns {@code true} if the resource is not yet loaded when this
 *         method was invoked, which indicates that a service call has been
 *         made to retrieve the attributes.
 * @see GetPlatformApplicationAttributesRequest
 */
boolean load(GetPlatformApplicationAttributesRequest request);
 
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:22,代码来源:PlatformApplication.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TransferState类代码示例发布时间:2022-05-22
下一篇:
Java Int16Array类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap