1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675
// ================================================================= // // * WARNING * // // This file is generated! // // Changes made to this file will be overwritten. If changes are // required to the generated code, the service_crategen project // must be updated to generate the changes. // // ================================================================= use std::error::Error; use std::fmt; #[allow(warnings)] use futures::future; use futures::Future; use rusoto_core::credential::ProvideAwsCredentials; use rusoto_core::region; use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest}; use rusoto_core::{Client, RusotoError, RusotoFuture}; use rusoto_core::proto; use rusoto_core::signature::SignedRequest; use serde_json; /// <p>Details of the common errors that all actions return.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct FailureInfo { /// <p>The code of the common error. Valid values include <code>InternalServiceException</code>, <code>InvalidParameterException</code>, and any valid error code returned by the AWS service that hosts the resource that you want to tag.</p> #[serde(rename = "ErrorCode")] #[serde(skip_serializing_if = "Option::is_none")] pub error_code: Option<String>, /// <p>The message of the common error.</p> #[serde(rename = "ErrorMessage")] #[serde(skip_serializing_if = "Option::is_none")] pub error_message: Option<String>, /// <p>The HTTP status code of the common error.</p> #[serde(rename = "StatusCode")] #[serde(skip_serializing_if = "Option::is_none")] pub status_code: Option<i64>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct GetResourcesInput { /// <p>A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a <code>PaginationToken</code>, use that string for this value to request an additional page of data.</p> #[serde(rename = "PaginationToken")] #[serde(skip_serializing_if = "Option::is_none")] pub pagination_token: Option<String>, /// <p><p>The constraints on the resources that you want returned. The format of each resource type is <code>service[:resourceType]</code>. For example, specifying a resource type of <code>ec2</code> returns all tagged Amazon EC2 resources (which includes tagged EC2 instances). Specifying a resource type of <code>ec2:instance</code> returns only EC2 instances. </p> <p>The string for each service name and resource type is the same as that embedded in a resource's Amazon Resource Name (ARN). Consult the <i>AWS General Reference</i> for the following:</p> <ul> <li> <p>For a list of service name strings, see <a href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces">AWS Service Namespaces</a>.</p> </li> <li> <p>For resource type strings, see <a href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-syntax">Example ARNs</a>.</p> </li> <li> <p>For more information about ARNs, see <a href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a>.</p> </li> </ul></p> #[serde(rename = "ResourceTypeFilters")] #[serde(skip_serializing_if = "Option::is_none")] pub resource_type_filters: Option<Vec<String>>, /// <p>A limit that restricts the number of resources returned by GetResources in paginated output. You can set ResourcesPerPage to a minimum of 1 item and the maximum of 50 items. </p> #[serde(rename = "ResourcesPerPage")] #[serde(skip_serializing_if = "Option::is_none")] pub resources_per_page: Option<i64>, /// <p>A list of tags (keys and values). A request can include up to 50 keys, and each key can include up to 20 values.</p> <p>If you specify multiple filters connected by an AND operator in a single request, the response returns only those resources that are associated with every specified filter.</p> <p>If you specify multiple filters connected by an OR operator in a single request, the response returns all resources that are associated with at least one or possibly more of the specified filters.</p> #[serde(rename = "TagFilters")] #[serde(skip_serializing_if = "Option::is_none")] pub tag_filters: Option<Vec<TagFilter>>, /// <p>A limit that restricts the number of tags (key and value pairs) returned by GetResources in paginated output. A resource with no tags is counted as having one tag (one key and value pair).</p> <p> <code>GetResources</code> does not split a resource and its associated tags across pages. If the specified <code>TagsPerPage</code> would cause such a break, a <code>PaginationToken</code> is returned in place of the affected resource and its tags. Use that token in another request to get the remaining data. For example, if you specify a <code>TagsPerPage</code> of <code>100</code> and the account has 22 resources with 10 tags each (meaning that each resource has 10 key and value pairs), the output will consist of 3 pages, with the first page displaying the first 10 resources, each with its 10 tags, the second page displaying the next 10 resources each with its 10 tags, and the third page displaying the remaining 2 resources, each with its 10 tags.</p> <p/> <p>You can set <code>TagsPerPage</code> to a minimum of 100 items and the maximum of 500 items.</p> #[serde(rename = "TagsPerPage")] #[serde(skip_serializing_if = "Option::is_none")] pub tags_per_page: Option<i64>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct GetResourcesOutput { /// <p>A string that indicates that the response contains more data than can be returned in a single response. To receive additional data, specify this string for the <code>PaginationToken</code> value in a subsequent request.</p> #[serde(rename = "PaginationToken")] #[serde(skip_serializing_if = "Option::is_none")] pub pagination_token: Option<String>, /// <p>A list of resource ARNs and the tags (keys and values) associated with each.</p> #[serde(rename = "ResourceTagMappingList")] #[serde(skip_serializing_if = "Option::is_none")] pub resource_tag_mapping_list: Option<Vec<ResourceTagMapping>>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct GetTagKeysInput { /// <p>A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a PaginationToken, use that string for this value to request an additional page of data.</p> #[serde(rename = "PaginationToken")] #[serde(skip_serializing_if = "Option::is_none")] pub pagination_token: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct GetTagKeysOutput { /// <p>A string that indicates that the response contains more data than can be returned in a single response. To receive additional data, specify this string for the <code>PaginationToken</code> value in a subsequent request.</p> #[serde(rename = "PaginationToken")] #[serde(skip_serializing_if = "Option::is_none")] pub pagination_token: Option<String>, /// <p>A list of all tag keys in the AWS account.</p> #[serde(rename = "TagKeys")] #[serde(skip_serializing_if = "Option::is_none")] pub tag_keys: Option<Vec<String>>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct GetTagValuesInput { /// <p>The key for which you want to list all existing values in the specified region for the AWS account.</p> #[serde(rename = "Key")] pub key: String, /// <p>A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a PaginationToken, use that string for this value to request an additional page of data.</p> #[serde(rename = "PaginationToken")] #[serde(skip_serializing_if = "Option::is_none")] pub pagination_token: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct GetTagValuesOutput { /// <p>A string that indicates that the response contains more data than can be returned in a single response. To receive additional data, specify this string for the <code>PaginationToken</code> value in a subsequent request.</p> #[serde(rename = "PaginationToken")] #[serde(skip_serializing_if = "Option::is_none")] pub pagination_token: Option<String>, /// <p>A list of all tag values for the specified key in the AWS account.</p> #[serde(rename = "TagValues")] #[serde(skip_serializing_if = "Option::is_none")] pub tag_values: Option<Vec<String>>, } /// <p>A list of resource ARNs and the tags (keys and values) that are associated with each.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct ResourceTagMapping { /// <p>An array of resource ARN(s).</p> #[serde(rename = "ResourceARN")] #[serde(skip_serializing_if = "Option::is_none")] pub resource_arn: Option<String>, /// <p>The tags that have been applied to one or more AWS resources.</p> #[serde(rename = "Tags")] #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option<Vec<Tag>>, } /// <p>The metadata that you apply to AWS resources to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. For more information, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-basics">Tag Basics</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct Tag { /// <p>One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.</p> #[serde(rename = "Key")] pub key: String, /// <p>The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).</p> #[serde(rename = "Value")] pub value: String, } /// <p>A list of tags (keys and values) that are used to specify the associated resources.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct TagFilter { /// <p>One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.</p> #[serde(rename = "Key")] #[serde(skip_serializing_if = "Option::is_none")] pub key: Option<String>, /// <p>The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).</p> #[serde(rename = "Values")] #[serde(skip_serializing_if = "Option::is_none")] pub values: Option<Vec<String>>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct TagResourcesInput { /// <p>A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to tag. An ARN can be set to a maximum of 1600 characters. For more information, see <a href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p> #[serde(rename = "ResourceARNList")] pub resource_arn_list: Vec<String>, /// <p>The tags that you want to add to the specified resources. A tag consists of a key and a value that you define.</p> #[serde(rename = "Tags")] pub tags: ::std::collections::HashMap<String, String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct TagResourcesOutput { /// <p>Details of resources that could not be tagged. An error code, status code, and error message are returned for each failed item.</p> #[serde(rename = "FailedResourcesMap")] #[serde(skip_serializing_if = "Option::is_none")] pub failed_resources_map: Option<::std::collections::HashMap<String, FailureInfo>>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct UntagResourcesInput { /// <p>A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to untag. An ARN can be set to a maximum of 1600 characters. For more information, see <a href="http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p> #[serde(rename = "ResourceARNList")] pub resource_arn_list: Vec<String>, /// <p>A list of the tag keys that you want to remove from the specified resources.</p> #[serde(rename = "TagKeys")] pub tag_keys: Vec<String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct UntagResourcesOutput { /// <p>Details of resources that could not be untagged. An error code, status code, and error message are returned for each failed item.</p> #[serde(rename = "FailedResourcesMap")] #[serde(skip_serializing_if = "Option::is_none")] pub failed_resources_map: Option<::std::collections::HashMap<String, FailureInfo>>, } /// Errors returned by GetResources #[derive(Debug, PartialEq)] pub enum GetResourcesError { /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p> InternalService(String), /// <p>A parameter is missing or a malformed string or invalid or out-of-range value was supplied for the request parameter.</p> InvalidParameter(String), /// <p>A <code>PaginationToken</code> is valid for a maximum of 15 minutes. Your request was denied because the specified <code>PaginationToken</code> has expired.</p> PaginationTokenExpired(String), /// <p>The request was denied to limit the frequency of submitted requests.</p> Throttled(String), } impl GetResourcesError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetResourcesError> { if let Some(err) = proto::json::Error::parse(&res) { match err.typ.as_str() { "InternalServiceException" => { return RusotoError::Service(GetResourcesError::InternalService(err.msg)) } "InvalidParameterException" => { return RusotoError::Service(GetResourcesError::InvalidParameter(err.msg)) } "PaginationTokenExpiredException" => { return RusotoError::Service(GetResourcesError::PaginationTokenExpired(err.msg)) } "ThrottledException" => { return RusotoError::Service(GetResourcesError::Throttled(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for GetResourcesError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for GetResourcesError { fn description(&self) -> &str { match *self { GetResourcesError::InternalService(ref cause) => cause, GetResourcesError::InvalidParameter(ref cause) => cause, GetResourcesError::PaginationTokenExpired(ref cause) => cause, GetResourcesError::Throttled(ref cause) => cause, } } } /// Errors returned by GetTagKeys #[derive(Debug, PartialEq)] pub enum GetTagKeysError { /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p> InternalService(String), /// <p>A parameter is missing or a malformed string or invalid or out-of-range value was supplied for the request parameter.</p> InvalidParameter(String), /// <p>A <code>PaginationToken</code> is valid for a maximum of 15 minutes. Your request was denied because the specified <code>PaginationToken</code> has expired.</p> PaginationTokenExpired(String), /// <p>The request was denied to limit the frequency of submitted requests.</p> Throttled(String), } impl GetTagKeysError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetTagKeysError> { if let Some(err) = proto::json::Error::parse(&res) { match err.typ.as_str() { "InternalServiceException" => { return RusotoError::Service(GetTagKeysError::InternalService(err.msg)) } "InvalidParameterException" => { return RusotoError::Service(GetTagKeysError::InvalidParameter(err.msg)) } "PaginationTokenExpiredException" => { return RusotoError::Service(GetTagKeysError::PaginationTokenExpired(err.msg)) } "ThrottledException" => { return RusotoError::Service(GetTagKeysError::Throttled(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for GetTagKeysError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for GetTagKeysError { fn description(&self) -> &str { match *self { GetTagKeysError::InternalService(ref cause) => cause, GetTagKeysError::InvalidParameter(ref cause) => cause, GetTagKeysError::PaginationTokenExpired(ref cause) => cause, GetTagKeysError::Throttled(ref cause) => cause, } } } /// Errors returned by GetTagValues #[derive(Debug, PartialEq)] pub enum GetTagValuesError { /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p> InternalService(String), /// <p>A parameter is missing or a malformed string or invalid or out-of-range value was supplied for the request parameter.</p> InvalidParameter(String), /// <p>A <code>PaginationToken</code> is valid for a maximum of 15 minutes. Your request was denied because the specified <code>PaginationToken</code> has expired.</p> PaginationTokenExpired(String), /// <p>The request was denied to limit the frequency of submitted requests.</p> Throttled(String), } impl GetTagValuesError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetTagValuesError> { if let Some(err) = proto::json::Error::parse(&res) { match err.typ.as_str() { "InternalServiceException" => { return RusotoError::Service(GetTagValuesError::InternalService(err.msg)) } "InvalidParameterException" => { return RusotoError::Service(GetTagValuesError::InvalidParameter(err.msg)) } "PaginationTokenExpiredException" => { return RusotoError::Service(GetTagValuesError::PaginationTokenExpired(err.msg)) } "ThrottledException" => { return RusotoError::Service(GetTagValuesError::Throttled(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for GetTagValuesError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for GetTagValuesError { fn description(&self) -> &str { match *self { GetTagValuesError::InternalService(ref cause) => cause, GetTagValuesError::InvalidParameter(ref cause) => cause, GetTagValuesError::PaginationTokenExpired(ref cause) => cause, GetTagValuesError::Throttled(ref cause) => cause, } } } /// Errors returned by TagResources #[derive(Debug, PartialEq)] pub enum TagResourcesError { /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p> InternalService(String), /// <p>A parameter is missing or a malformed string or invalid or out-of-range value was supplied for the request parameter.</p> InvalidParameter(String), /// <p>The request was denied to limit the frequency of submitted requests.</p> Throttled(String), } impl TagResourcesError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourcesError> { if let Some(err) = proto::json::Error::parse(&res) { match err.typ.as_str() { "InternalServiceException" => { return RusotoError::Service(TagResourcesError::InternalService(err.msg)) } "InvalidParameterException" => { return RusotoError::Service(TagResourcesError::InvalidParameter(err.msg)) } "ThrottledException" => { return RusotoError::Service(TagResourcesError::Throttled(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for TagResourcesError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for TagResourcesError { fn description(&self) -> &str { match *self { TagResourcesError::InternalService(ref cause) => cause, TagResourcesError::InvalidParameter(ref cause) => cause, TagResourcesError::Throttled(ref cause) => cause, } } } /// Errors returned by UntagResources #[derive(Debug, PartialEq)] pub enum UntagResourcesError { /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p> InternalService(String), /// <p>A parameter is missing or a malformed string or invalid or out-of-range value was supplied for the request parameter.</p> InvalidParameter(String), /// <p>The request was denied to limit the frequency of submitted requests.</p> Throttled(String), } impl UntagResourcesError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourcesError> { if let Some(err) = proto::json::Error::parse(&res) { match err.typ.as_str() { "InternalServiceException" => { return RusotoError::Service(UntagResourcesError::InternalService(err.msg)) } "InvalidParameterException" => { return RusotoError::Service(UntagResourcesError::InvalidParameter(err.msg)) } "ThrottledException" => { return RusotoError::Service(UntagResourcesError::Throttled(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for UntagResourcesError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for UntagResourcesError { fn description(&self) -> &str { match *self { UntagResourcesError::InternalService(ref cause) => cause, UntagResourcesError::InvalidParameter(ref cause) => cause, UntagResourcesError::Throttled(ref cause) => cause, } } } /// Trait representing the capabilities of the AWS Resource Groups Tagging API API. AWS Resource Groups Tagging API clients implement this trait. pub trait ResourceGroupsTaggingApi { /// <p>Returns all the tagged resources that are associated with the specified tags (keys and values) located in the specified region for the AWS account. The tags and the resource types that you specify in the request are known as <i>filters</i>. The response includes all tags that are associated with the requested resources. If no filter is provided, this action returns a paginated resource list with the associated tags.</p> fn get_resources( &self, input: GetResourcesInput, ) -> RusotoFuture<GetResourcesOutput, GetResourcesError>; /// <p>Returns all tag keys in the specified region for the AWS account.</p> fn get_tag_keys( &self, input: GetTagKeysInput, ) -> RusotoFuture<GetTagKeysOutput, GetTagKeysError>; /// <p>Returns all tag values for the specified key in the specified region for the AWS account.</p> fn get_tag_values( &self, input: GetTagValuesInput, ) -> RusotoFuture<GetTagValuesOutput, GetTagValuesError>; /// <p><p>Applies one or more tags to the specified resources. Note the following:</p> <ul> <li> <p>Not all resources can have tags. For a list of resources that support tagging, see <a href="http://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/supported-resources.html">Supported Resources</a> in the <i>AWS Resource Groups and Tag Editor User Guide</i>.</p> </li> <li> <p>Each resource can have up to 50 tags. For other limits, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions">Tag Restrictions</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> </li> <li> <p>You can only tag resources that are located in the specified region for the AWS account.</p> </li> <li> <p>To add tags to a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for adding tags. For more information, see <a href="http://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/obtaining-permissions-for-tagging.html">Obtaining Permissions for Tagging</a> in the <i>AWS Resource Groups and Tag Editor User Guide</i>.</p> </li> </ul></p> fn tag_resources( &self, input: TagResourcesInput, ) -> RusotoFuture<TagResourcesOutput, TagResourcesError>; /// <p><p>Removes the specified tags from the specified resources. When you specify a tag key, the action removes both that key and its associated value. The operation succeeds even if you attempt to remove tags from a resource that were already removed. Note the following:</p> <ul> <li> <p>To remove tags from a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for removing tags. For more information, see <a href="http://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/obtaining-permissions-for-tagging.html">Obtaining Permissions for Tagging</a> in the <i>AWS Resource Groups and Tag Editor User Guide</i>.</p> </li> <li> <p>You can only tag resources that are located in the specified region for the AWS account.</p> </li> </ul></p> fn untag_resources( &self, input: UntagResourcesInput, ) -> RusotoFuture<UntagResourcesOutput, UntagResourcesError>; } /// A client for the AWS Resource Groups Tagging API API. #[derive(Clone)] pub struct ResourceGroupsTaggingApiClient { client: Client, region: region::Region, } impl ResourceGroupsTaggingApiClient { /// Creates a client backed by the default tokio event loop. /// /// The client will use the default credentials provider and tls client. pub fn new(region: region::Region) -> ResourceGroupsTaggingApiClient { ResourceGroupsTaggingApiClient { client: Client::shared(), region, } } pub fn new_with<P, D>( request_dispatcher: D, credentials_provider: P, region: region::Region, ) -> ResourceGroupsTaggingApiClient where P: ProvideAwsCredentials + Send + Sync + 'static, P::Future: Send, D: DispatchSignedRequest + Send + Sync + 'static, D::Future: Send, { ResourceGroupsTaggingApiClient { client: Client::new_with(credentials_provider, request_dispatcher), region, } } } impl ResourceGroupsTaggingApi for ResourceGroupsTaggingApiClient { /// <p>Returns all the tagged resources that are associated with the specified tags (keys and values) located in the specified region for the AWS account. The tags and the resource types that you specify in the request are known as <i>filters</i>. The response includes all tags that are associated with the requested resources. If no filter is provided, this action returns a paginated resource list with the associated tags.</p> fn get_resources( &self, input: GetResourcesInput, ) -> RusotoFuture<GetResourcesOutput, GetResourcesError> { let mut request = SignedRequest::new("POST", "tagging", &self.region, "/"); request.set_content_type("application/x-amz-json-1.1".to_owned()); request.add_header( "x-amz-target", "ResourceGroupsTaggingAPI_20170126.GetResources", ); let encoded = serde_json::to_string(&input).unwrap(); request.set_payload(Some(encoded)); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { proto::json::ResponsePayload::new(&response) .deserialize::<GetResourcesOutput, _>() })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(GetResourcesError::from_response(response))), ) } }) } /// <p>Returns all tag keys in the specified region for the AWS account.</p> fn get_tag_keys( &self, input: GetTagKeysInput, ) -> RusotoFuture<GetTagKeysOutput, GetTagKeysError> { let mut request = SignedRequest::new("POST", "tagging", &self.region, "/"); request.set_content_type("application/x-amz-json-1.1".to_owned()); request.add_header( "x-amz-target", "ResourceGroupsTaggingAPI_20170126.GetTagKeys", ); let encoded = serde_json::to_string(&input).unwrap(); request.set_payload(Some(encoded)); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { proto::json::ResponsePayload::new(&response) .deserialize::<GetTagKeysOutput, _>() })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(GetTagKeysError::from_response(response))), ) } }) } /// <p>Returns all tag values for the specified key in the specified region for the AWS account.</p> fn get_tag_values( &self, input: GetTagValuesInput, ) -> RusotoFuture<GetTagValuesOutput, GetTagValuesError> { let mut request = SignedRequest::new("POST", "tagging", &self.region, "/"); request.set_content_type("application/x-amz-json-1.1".to_owned()); request.add_header( "x-amz-target", "ResourceGroupsTaggingAPI_20170126.GetTagValues", ); let encoded = serde_json::to_string(&input).unwrap(); request.set_payload(Some(encoded)); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { proto::json::ResponsePayload::new(&response) .deserialize::<GetTagValuesOutput, _>() })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(GetTagValuesError::from_response(response))), ) } }) } /// <p><p>Applies one or more tags to the specified resources. Note the following:</p> <ul> <li> <p>Not all resources can have tags. For a list of resources that support tagging, see <a href="http://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/supported-resources.html">Supported Resources</a> in the <i>AWS Resource Groups and Tag Editor User Guide</i>.</p> </li> <li> <p>Each resource can have up to 50 tags. For other limits, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions">Tag Restrictions</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> </li> <li> <p>You can only tag resources that are located in the specified region for the AWS account.</p> </li> <li> <p>To add tags to a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for adding tags. For more information, see <a href="http://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/obtaining-permissions-for-tagging.html">Obtaining Permissions for Tagging</a> in the <i>AWS Resource Groups and Tag Editor User Guide</i>.</p> </li> </ul></p> fn tag_resources( &self, input: TagResourcesInput, ) -> RusotoFuture<TagResourcesOutput, TagResourcesError> { let mut request = SignedRequest::new("POST", "tagging", &self.region, "/"); request.set_content_type("application/x-amz-json-1.1".to_owned()); request.add_header( "x-amz-target", "ResourceGroupsTaggingAPI_20170126.TagResources", ); let encoded = serde_json::to_string(&input).unwrap(); request.set_payload(Some(encoded)); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { proto::json::ResponsePayload::new(&response) .deserialize::<TagResourcesOutput, _>() })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(TagResourcesError::from_response(response))), ) } }) } /// <p><p>Removes the specified tags from the specified resources. When you specify a tag key, the action removes both that key and its associated value. The operation succeeds even if you attempt to remove tags from a resource that were already removed. Note the following:</p> <ul> <li> <p>To remove tags from a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for removing tags. For more information, see <a href="http://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/obtaining-permissions-for-tagging.html">Obtaining Permissions for Tagging</a> in the <i>AWS Resource Groups and Tag Editor User Guide</i>.</p> </li> <li> <p>You can only tag resources that are located in the specified region for the AWS account.</p> </li> </ul></p> fn untag_resources( &self, input: UntagResourcesInput, ) -> RusotoFuture<UntagResourcesOutput, UntagResourcesError> { let mut request = SignedRequest::new("POST", "tagging", &self.region, "/"); request.set_content_type("application/x-amz-json-1.1".to_owned()); request.add_header( "x-amz-target", "ResourceGroupsTaggingAPI_20170126.UntagResources", ); let encoded = serde_json::to_string(&input).unwrap(); request.set_payload(Some(encoded)); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { proto::json::ResponsePayload::new(&response) .deserialize::<UntagResourcesOutput, _>() })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(UntagResourcesError::from_response(response))), ) } }) } }