Java 类com.amazonaws.services.sns.model.SetSubscriptionAttributesRequest 实例源码

项目:unitstack    文件:MockSnsTest.java   
@Test
public void testSetGetSubscriptionAttributes_shouldSetAndRespondSubscriptionAttributes() {
  mockSns(new MockParameters());
  // create topic and subscription
  CreateTopicResult topicResult = sns.createTopic(new CreateTopicRequest().withName("important-topic"));
  SubscribeResult subscribeResult = sns.subscribe(new SubscribeRequest().withTopicArn(topicResult.getTopicArn())
      .withProtocol("sqs").withEndpoint("arn:aws:sqs:us-east-1:123456789012:queue1"));
  // set subscription attribute
  SetSubscriptionAttributesResult setAttrResult =  sns.setSubscriptionAttributes(new SetSubscriptionAttributesRequest()
      .withAttributeName("unicorns-exist").withAttributeValue("only in scotland").withSubscriptionArn(subscribeResult.getSubscriptionArn()));
  assertNotNull("verify setting attributes result", setAttrResult);
  // get subscription attribute
  GetSubscriptionAttributesResult subAttributes = sns.getSubscriptionAttributes(new GetSubscriptionAttributesRequest()
      .withSubscriptionArn(subscribeResult.getSubscriptionArn()));
  assertEquals("verify subscription attribute","only in scotland",subAttributes.getAttributes().get("unicorns-exist"));
}
项目:aws-sdk-java-resources    文件:SubscriptionImpl.java   
@Override
public void setAttributes(String attributeName, String attributeValue,
        ResultCapture<Void> extractor) {

    SetSubscriptionAttributesRequest request = new
            SetSubscriptionAttributesRequest()

        .withAttributeName(attributeName)
        .withAttributeValue(attributeValue);
    setAttributes(request, extractor);
}
项目:unitstack    文件:MockSnsTest.java   
@Test
public void testSetSubscriptionAttributes_withNoRequestParams_shouldWork() {
  mockSns(new MockParameters());
  assertNotNull(sns.setSubscriptionAttributes(new SetSubscriptionAttributesRequest()));
}
项目:aws-sdk-java-resources    文件:SubscriptionImpl.java   
@Override
public void setAttributes(SetSubscriptionAttributesRequest request) {
    setAttributes(request, null);
}
项目:aws-sdk-java-resources    文件:SubscriptionImpl.java   
@Override
public void setAttributes(SetSubscriptionAttributesRequest request,
        ResultCapture<Void> extractor) {

    resource.performAction("SetAttributes", request, extractor);
}
项目:aws-sdk-java-resources    文件:Subscription.java   
/**
 * Performs the <code>SetAttributes</code> action.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Subscription</code> resource, and any conflicting parameter value
 * set in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>SubscriptionArn</code></b>
 *         - mapped from the <code>Arn</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @see SetSubscriptionAttributesRequest
 */
void setAttributes(SetSubscriptionAttributesRequest request);
项目:aws-sdk-java-resources    文件:Subscription.java   
/**
 * Performs the <code>SetAttributes</code> action and use a ResultCapture to
 * retrieve the low-level client response.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Subscription</code> resource, and any conflicting parameter value
 * set in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>SubscriptionArn</code></b>
 *         - mapped from the <code>Arn</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @see SetSubscriptionAttributesRequest
 */
void setAttributes(SetSubscriptionAttributesRequest request,
        ResultCapture<Void> extractor);