set_topic_attributes ( $topic_arn, $attribute_name, $attribute_value, $opt )

The SetTopicAttributes action allows a topic owner to set an attribute of the topic to a new value.

Access

public

Parameters

Parameter

Type

Required

Description

$topic_arn

string

Required

The ARN of the topic to modify.

$attribute_name

string

Required

The name of the attribute you want to set. Only a subset of the topic’s attributes are mutable. Valid values: Policy | DisplayName

$attribute_value

string

Required

The new value for the attribute.

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Set an attribute for a given topic.

$sns = new AmazonSNS();

// Get topic attributes
$response = $sns->set_topic_attributes(
	'arn:aws:sns:us-east-1:9876543210:example-topic',
	'DisplayName',
	'my-display-value'
);

// Success?
var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/sns.class.php | Toggle source view (9 lines) | View on GitHub

public function set_topic_attributes($topic_arn, $attribute_name, $attribute_value, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['TopicArn'] = $topic_arn;
    $opt['AttributeName'] = $attribute_name;
    $opt['AttributeValue'] = $attribute_value;
    
    return $this->authenticate('SetTopicAttributes', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback