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 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents the current status of a resource operation request. For more information, see <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-manage-requests.html">Managing resource operation requests</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ProgressEvent {
/// <p>The name of the resource type used in the operation.</p>
pub type_name: std::option::Option<std::string::String>,
/// <p>The primary identifier for the resource.</p> <note>
/// <p>In some cases, the resource identifier may be available before the resource operation has reached a status of <code>SUCCESS</code>.</p>
/// </note>
pub identifier: std::option::Option<std::string::String>,
/// <p>The unique token representing this resource operation request.</p>
/// <p>Use the <code>RequestToken</code> with <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">GetResourceRequestStatus</a> to return the current status of a resource operation request.</p>
pub request_token: std::option::Option<std::string::String>,
/// <p>The resource operation type.</p>
pub operation: std::option::Option<crate::model::Operation>,
/// <p>The current status of the resource operation request.</p>
/// <ul>
/// <li> <p> <code>PENDING</code>: The resource operation has not yet started.</p> </li>
/// <li> <p> <code>IN_PROGRESS</code>: The resource operation is currently in progress.</p> </li>
/// <li> <p> <code>SUCCESS</code>: The resource operation has successfully completed.</p> </li>
/// <li> <p> <code>FAILED</code>: The resource operation has failed. Refer to the error code and status message for more information.</p> </li>
/// <li> <p> <code>CANCEL_IN_PROGRESS</code>: The resource operation is in the process of being canceled.</p> </li>
/// <li> <p> <code>CANCEL_COMPLETE</code>: The resource operation has been canceled.</p> </li>
/// </ul>
pub operation_status: std::option::Option<crate::model::OperationStatus>,
/// <p>When the resource operation request was initiated.</p>
pub event_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p>A JSON string containing the resource model, consisting of each resource property and its current value.</p>
pub resource_model: std::option::Option<std::string::String>,
/// <p>Any message explaining the current status.</p>
pub status_message: std::option::Option<std::string::String>,
/// <p>For requests with a status of <code>FAILED</code>, the associated error code.</p>
/// <p>For error code definitions, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract-errors.html">Handler error codes</a> in the <i>CloudFormation Command Line Interface User Guide for Extension Development</i>.</p>
pub error_code: std::option::Option<crate::model::HandlerErrorCode>,
/// <p>When to next request the status of this resource operation request.</p>
pub retry_after: std::option::Option<aws_smithy_types::DateTime>,
}
impl ProgressEvent {
/// <p>The name of the resource type used in the operation.</p>
pub fn type_name(&self) -> std::option::Option<&str> {
self.type_name.as_deref()
}
/// <p>The primary identifier for the resource.</p> <note>
/// <p>In some cases, the resource identifier may be available before the resource operation has reached a status of <code>SUCCESS</code>.</p>
/// </note>
pub fn identifier(&self) -> std::option::Option<&str> {
self.identifier.as_deref()
}
/// <p>The unique token representing this resource operation request.</p>
/// <p>Use the <code>RequestToken</code> with <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">GetResourceRequestStatus</a> to return the current status of a resource operation request.</p>
pub fn request_token(&self) -> std::option::Option<&str> {
self.request_token.as_deref()
}
/// <p>The resource operation type.</p>
pub fn operation(&self) -> std::option::Option<&crate::model::Operation> {
self.operation.as_ref()
}
/// <p>The current status of the resource operation request.</p>
/// <ul>
/// <li> <p> <code>PENDING</code>: The resource operation has not yet started.</p> </li>
/// <li> <p> <code>IN_PROGRESS</code>: The resource operation is currently in progress.</p> </li>
/// <li> <p> <code>SUCCESS</code>: The resource operation has successfully completed.</p> </li>
/// <li> <p> <code>FAILED</code>: The resource operation has failed. Refer to the error code and status message for more information.</p> </li>
/// <li> <p> <code>CANCEL_IN_PROGRESS</code>: The resource operation is in the process of being canceled.</p> </li>
/// <li> <p> <code>CANCEL_COMPLETE</code>: The resource operation has been canceled.</p> </li>
/// </ul>
pub fn operation_status(&self) -> std::option::Option<&crate::model::OperationStatus> {
self.operation_status.as_ref()
}
/// <p>When the resource operation request was initiated.</p>
pub fn event_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.event_time.as_ref()
}
/// <p>A JSON string containing the resource model, consisting of each resource property and its current value.</p>
pub fn resource_model(&self) -> std::option::Option<&str> {
self.resource_model.as_deref()
}
/// <p>Any message explaining the current status.</p>
pub fn status_message(&self) -> std::option::Option<&str> {
self.status_message.as_deref()
}
/// <p>For requests with a status of <code>FAILED</code>, the associated error code.</p>
/// <p>For error code definitions, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract-errors.html">Handler error codes</a> in the <i>CloudFormation Command Line Interface User Guide for Extension Development</i>.</p>
pub fn error_code(&self) -> std::option::Option<&crate::model::HandlerErrorCode> {
self.error_code.as_ref()
}
/// <p>When to next request the status of this resource operation request.</p>
pub fn retry_after(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.retry_after.as_ref()
}
}
impl std::fmt::Debug for ProgressEvent {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ProgressEvent");
formatter.field("type_name", &self.type_name);
formatter.field("identifier", &self.identifier);
formatter.field("request_token", &self.request_token);
formatter.field("operation", &self.operation);
formatter.field("operation_status", &self.operation_status);
formatter.field("event_time", &self.event_time);
formatter.field("resource_model", &"*** Sensitive Data Redacted ***");
formatter.field("status_message", &self.status_message);
formatter.field("error_code", &self.error_code);
formatter.field("retry_after", &self.retry_after);
formatter.finish()
}
}
/// See [`ProgressEvent`](crate::model::ProgressEvent)
pub mod progress_event {
/// A builder for [`ProgressEvent`](crate::model::ProgressEvent)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) type_name: std::option::Option<std::string::String>,
pub(crate) identifier: std::option::Option<std::string::String>,
pub(crate) request_token: std::option::Option<std::string::String>,
pub(crate) operation: std::option::Option<crate::model::Operation>,
pub(crate) operation_status: std::option::Option<crate::model::OperationStatus>,
pub(crate) event_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) resource_model: std::option::Option<std::string::String>,
pub(crate) status_message: std::option::Option<std::string::String>,
pub(crate) error_code: std::option::Option<crate::model::HandlerErrorCode>,
pub(crate) retry_after: std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
/// <p>The name of the resource type used in the operation.</p>
pub fn type_name(mut self, input: impl Into<std::string::String>) -> Self {
self.type_name = Some(input.into());
self
}
/// <p>The name of the resource type used in the operation.</p>
pub fn set_type_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.type_name = input;
self
}
/// <p>The primary identifier for the resource.</p> <note>
/// <p>In some cases, the resource identifier may be available before the resource operation has reached a status of <code>SUCCESS</code>.</p>
/// </note>
pub fn identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.identifier = Some(input.into());
self
}
/// <p>The primary identifier for the resource.</p> <note>
/// <p>In some cases, the resource identifier may be available before the resource operation has reached a status of <code>SUCCESS</code>.</p>
/// </note>
pub fn set_identifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identifier = input;
self
}
/// <p>The unique token representing this resource operation request.</p>
/// <p>Use the <code>RequestToken</code> with <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">GetResourceRequestStatus</a> to return the current status of a resource operation request.</p>
pub fn request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.request_token = Some(input.into());
self
}
/// <p>The unique token representing this resource operation request.</p>
/// <p>Use the <code>RequestToken</code> with <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html">GetResourceRequestStatus</a> to return the current status of a resource operation request.</p>
pub fn set_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.request_token = input;
self
}
/// <p>The resource operation type.</p>
pub fn operation(mut self, input: crate::model::Operation) -> Self {
self.operation = Some(input);
self
}
/// <p>The resource operation type.</p>
pub fn set_operation(
mut self,
input: std::option::Option<crate::model::Operation>,
) -> Self {
self.operation = input;
self
}
/// <p>The current status of the resource operation request.</p>
/// <ul>
/// <li> <p> <code>PENDING</code>: The resource operation has not yet started.</p> </li>
/// <li> <p> <code>IN_PROGRESS</code>: The resource operation is currently in progress.</p> </li>
/// <li> <p> <code>SUCCESS</code>: The resource operation has successfully completed.</p> </li>
/// <li> <p> <code>FAILED</code>: The resource operation has failed. Refer to the error code and status message for more information.</p> </li>
/// <li> <p> <code>CANCEL_IN_PROGRESS</code>: The resource operation is in the process of being canceled.</p> </li>
/// <li> <p> <code>CANCEL_COMPLETE</code>: The resource operation has been canceled.</p> </li>
/// </ul>
pub fn operation_status(mut self, input: crate::model::OperationStatus) -> Self {
self.operation_status = Some(input);
self
}
/// <p>The current status of the resource operation request.</p>
/// <ul>
/// <li> <p> <code>PENDING</code>: The resource operation has not yet started.</p> </li>
/// <li> <p> <code>IN_PROGRESS</code>: The resource operation is currently in progress.</p> </li>
/// <li> <p> <code>SUCCESS</code>: The resource operation has successfully completed.</p> </li>
/// <li> <p> <code>FAILED</code>: The resource operation has failed. Refer to the error code and status message for more information.</p> </li>
/// <li> <p> <code>CANCEL_IN_PROGRESS</code>: The resource operation is in the process of being canceled.</p> </li>
/// <li> <p> <code>CANCEL_COMPLETE</code>: The resource operation has been canceled.</p> </li>
/// </ul>
pub fn set_operation_status(
mut self,
input: std::option::Option<crate::model::OperationStatus>,
) -> Self {
self.operation_status = input;
self
}
/// <p>When the resource operation request was initiated.</p>
pub fn event_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.event_time = Some(input);
self
}
/// <p>When the resource operation request was initiated.</p>
pub fn set_event_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.event_time = input;
self
}
/// <p>A JSON string containing the resource model, consisting of each resource property and its current value.</p>
pub fn resource_model(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_model = Some(input.into());
self
}
/// <p>A JSON string containing the resource model, consisting of each resource property and its current value.</p>
pub fn set_resource_model(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_model = input;
self
}
/// <p>Any message explaining the current status.</p>
pub fn status_message(mut self, input: impl Into<std::string::String>) -> Self {
self.status_message = Some(input.into());
self
}
/// <p>Any message explaining the current status.</p>
pub fn set_status_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.status_message = input;
self
}
/// <p>For requests with a status of <code>FAILED</code>, the associated error code.</p>
/// <p>For error code definitions, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract-errors.html">Handler error codes</a> in the <i>CloudFormation Command Line Interface User Guide for Extension Development</i>.</p>
pub fn error_code(mut self, input: crate::model::HandlerErrorCode) -> Self {
self.error_code = Some(input);
self
}
/// <p>For requests with a status of <code>FAILED</code>, the associated error code.</p>
/// <p>For error code definitions, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-test-contract-errors.html">Handler error codes</a> in the <i>CloudFormation Command Line Interface User Guide for Extension Development</i>.</p>
pub fn set_error_code(
mut self,
input: std::option::Option<crate::model::HandlerErrorCode>,
) -> Self {
self.error_code = input;
self
}
/// <p>When to next request the status of this resource operation request.</p>
pub fn retry_after(mut self, input: aws_smithy_types::DateTime) -> Self {
self.retry_after = Some(input);
self
}
/// <p>When to next request the status of this resource operation request.</p>
pub fn set_retry_after(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.retry_after = input;
self
}
/// Consumes the builder and constructs a [`ProgressEvent`](crate::model::ProgressEvent)
pub fn build(self) -> crate::model::ProgressEvent {
crate::model::ProgressEvent {
type_name: self.type_name,
identifier: self.identifier,
request_token: self.request_token,
operation: self.operation,
operation_status: self.operation_status,
event_time: self.event_time,
resource_model: self.resource_model,
status_message: self.status_message,
error_code: self.error_code,
retry_after: self.retry_after,
}
}
}
}
impl ProgressEvent {
/// Creates a new builder-style object to manufacture [`ProgressEvent`](crate::model::ProgressEvent)
pub fn builder() -> crate::model::progress_event::Builder {
crate::model::progress_event::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum HandlerErrorCode {
#[allow(missing_docs)] // documentation missing in model
AccessDenied,
#[allow(missing_docs)] // documentation missing in model
AlreadyExists,
#[allow(missing_docs)] // documentation missing in model
GeneralServiceException,
#[allow(missing_docs)] // documentation missing in model
InternalFailure,
#[allow(missing_docs)] // documentation missing in model
InvalidCredentials,
#[allow(missing_docs)] // documentation missing in model
InvalidRequest,
#[allow(missing_docs)] // documentation missing in model
NetworkFailure,
#[allow(missing_docs)] // documentation missing in model
NotFound,
#[allow(missing_docs)] // documentation missing in model
NotStabilized,
#[allow(missing_docs)] // documentation missing in model
NotUpdatable,
#[allow(missing_docs)] // documentation missing in model
ResourceConflict,
#[allow(missing_docs)] // documentation missing in model
ServiceInternalError,
#[allow(missing_docs)] // documentation missing in model
ServiceLimitExceeded,
#[allow(missing_docs)] // documentation missing in model
ServiceTimeout,
#[allow(missing_docs)] // documentation missing in model
Throttling,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for HandlerErrorCode {
fn from(s: &str) -> Self {
match s {
"AccessDenied" => HandlerErrorCode::AccessDenied,
"AlreadyExists" => HandlerErrorCode::AlreadyExists,
"GeneralServiceException" => HandlerErrorCode::GeneralServiceException,
"InternalFailure" => HandlerErrorCode::InternalFailure,
"InvalidCredentials" => HandlerErrorCode::InvalidCredentials,
"InvalidRequest" => HandlerErrorCode::InvalidRequest,
"NetworkFailure" => HandlerErrorCode::NetworkFailure,
"NotFound" => HandlerErrorCode::NotFound,
"NotStabilized" => HandlerErrorCode::NotStabilized,
"NotUpdatable" => HandlerErrorCode::NotUpdatable,
"ResourceConflict" => HandlerErrorCode::ResourceConflict,
"ServiceInternalError" => HandlerErrorCode::ServiceInternalError,
"ServiceLimitExceeded" => HandlerErrorCode::ServiceLimitExceeded,
"ServiceTimeout" => HandlerErrorCode::ServiceTimeout,
"Throttling" => HandlerErrorCode::Throttling,
other => HandlerErrorCode::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for HandlerErrorCode {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(HandlerErrorCode::from(s))
}
}
impl HandlerErrorCode {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
HandlerErrorCode::AccessDenied => "AccessDenied",
HandlerErrorCode::AlreadyExists => "AlreadyExists",
HandlerErrorCode::GeneralServiceException => "GeneralServiceException",
HandlerErrorCode::InternalFailure => "InternalFailure",
HandlerErrorCode::InvalidCredentials => "InvalidCredentials",
HandlerErrorCode::InvalidRequest => "InvalidRequest",
HandlerErrorCode::NetworkFailure => "NetworkFailure",
HandlerErrorCode::NotFound => "NotFound",
HandlerErrorCode::NotStabilized => "NotStabilized",
HandlerErrorCode::NotUpdatable => "NotUpdatable",
HandlerErrorCode::ResourceConflict => "ResourceConflict",
HandlerErrorCode::ServiceInternalError => "ServiceInternalError",
HandlerErrorCode::ServiceLimitExceeded => "ServiceLimitExceeded",
HandlerErrorCode::ServiceTimeout => "ServiceTimeout",
HandlerErrorCode::Throttling => "Throttling",
HandlerErrorCode::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"AccessDenied",
"AlreadyExists",
"GeneralServiceException",
"InternalFailure",
"InvalidCredentials",
"InvalidRequest",
"NetworkFailure",
"NotFound",
"NotStabilized",
"NotUpdatable",
"ResourceConflict",
"ServiceInternalError",
"ServiceLimitExceeded",
"ServiceTimeout",
"Throttling",
]
}
}
impl AsRef<str> for HandlerErrorCode {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum OperationStatus {
#[allow(missing_docs)] // documentation missing in model
CancelComplete,
#[allow(missing_docs)] // documentation missing in model
CancelInProgress,
#[allow(missing_docs)] // documentation missing in model
Failed,
#[allow(missing_docs)] // documentation missing in model
InProgress,
#[allow(missing_docs)] // documentation missing in model
Pending,
#[allow(missing_docs)] // documentation missing in model
Success,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for OperationStatus {
fn from(s: &str) -> Self {
match s {
"CANCEL_COMPLETE" => OperationStatus::CancelComplete,
"CANCEL_IN_PROGRESS" => OperationStatus::CancelInProgress,
"FAILED" => OperationStatus::Failed,
"IN_PROGRESS" => OperationStatus::InProgress,
"PENDING" => OperationStatus::Pending,
"SUCCESS" => OperationStatus::Success,
other => OperationStatus::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for OperationStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(OperationStatus::from(s))
}
}
impl OperationStatus {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
OperationStatus::CancelComplete => "CANCEL_COMPLETE",
OperationStatus::CancelInProgress => "CANCEL_IN_PROGRESS",
OperationStatus::Failed => "FAILED",
OperationStatus::InProgress => "IN_PROGRESS",
OperationStatus::Pending => "PENDING",
OperationStatus::Success => "SUCCESS",
OperationStatus::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"CANCEL_COMPLETE",
"CANCEL_IN_PROGRESS",
"FAILED",
"IN_PROGRESS",
"PENDING",
"SUCCESS",
]
}
}
impl AsRef<str> for OperationStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum Operation {
#[allow(missing_docs)] // documentation missing in model
Create,
#[allow(missing_docs)] // documentation missing in model
Delete,
#[allow(missing_docs)] // documentation missing in model
Update,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for Operation {
fn from(s: &str) -> Self {
match s {
"CREATE" => Operation::Create,
"DELETE" => Operation::Delete,
"UPDATE" => Operation::Update,
other => Operation::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for Operation {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(Operation::from(s))
}
}
impl Operation {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
Operation::Create => "CREATE",
Operation::Delete => "DELETE",
Operation::Update => "UPDATE",
Operation::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["CREATE", "DELETE", "UPDATE"]
}
}
impl AsRef<str> for Operation {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Represents information about a provisioned resource.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ResourceDescription {
/// <p>The primary identifier for the resource.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html">Identifying resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
pub identifier: std::option::Option<std::string::String>,
/// <p>A list of the resource properties and their current values.</p>
pub properties: std::option::Option<std::string::String>,
}
impl ResourceDescription {
/// <p>The primary identifier for the resource.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html">Identifying resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
pub fn identifier(&self) -> std::option::Option<&str> {
self.identifier.as_deref()
}
/// <p>A list of the resource properties and their current values.</p>
pub fn properties(&self) -> std::option::Option<&str> {
self.properties.as_deref()
}
}
impl std::fmt::Debug for ResourceDescription {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ResourceDescription");
formatter.field("identifier", &self.identifier);
formatter.field("properties", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
/// See [`ResourceDescription`](crate::model::ResourceDescription)
pub mod resource_description {
/// A builder for [`ResourceDescription`](crate::model::ResourceDescription)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) identifier: std::option::Option<std::string::String>,
pub(crate) properties: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The primary identifier for the resource.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html">Identifying resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
pub fn identifier(mut self, input: impl Into<std::string::String>) -> Self {
self.identifier = Some(input.into());
self
}
/// <p>The primary identifier for the resource.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html">Identifying resources</a> in the <i>Amazon Web Services Cloud Control API User Guide</i>.</p>
pub fn set_identifier(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identifier = input;
self
}
/// <p>A list of the resource properties and their current values.</p>
pub fn properties(mut self, input: impl Into<std::string::String>) -> Self {
self.properties = Some(input.into());
self
}
/// <p>A list of the resource properties and their current values.</p>
pub fn set_properties(mut self, input: std::option::Option<std::string::String>) -> Self {
self.properties = input;
self
}
/// Consumes the builder and constructs a [`ResourceDescription`](crate::model::ResourceDescription)
pub fn build(self) -> crate::model::ResourceDescription {
crate::model::ResourceDescription {
identifier: self.identifier,
properties: self.properties,
}
}
}
}
impl ResourceDescription {
/// Creates a new builder-style object to manufacture [`ResourceDescription`](crate::model::ResourceDescription)
pub fn builder() -> crate::model::resource_description::Builder {
crate::model::resource_description::Builder::default()
}
}
/// <p>The filter criteria to use in determining the requests returned.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ResourceRequestStatusFilter {
/// <p>The operation types to include in the filter.</p>
pub operations: std::option::Option<std::vec::Vec<crate::model::Operation>>,
/// <p>The operation statuses to include in the filter.</p>
/// <ul>
/// <li> <p> <code>PENDING</code>: The operation has been requested, but not yet initiated.</p> </li>
/// <li> <p> <code>IN_PROGRESS</code>: The operation is currently in progress.</p> </li>
/// <li> <p> <code>SUCCESS</code>: The operation has successfully completed.</p> </li>
/// <li> <p> <code>FAILED</code>: The operation has failed.</p> </li>
/// <li> <p> <code>CANCEL_IN_PROGRESS</code>: The operation is currently in the process of being canceled.</p> </li>
/// <li> <p> <code>CANCEL_COMPLETE</code>: The operation has been canceled.</p> </li>
/// </ul>
pub operation_statuses: std::option::Option<std::vec::Vec<crate::model::OperationStatus>>,
}
impl ResourceRequestStatusFilter {
/// <p>The operation types to include in the filter.</p>
pub fn operations(&self) -> std::option::Option<&[crate::model::Operation]> {
self.operations.as_deref()
}
/// <p>The operation statuses to include in the filter.</p>
/// <ul>
/// <li> <p> <code>PENDING</code>: The operation has been requested, but not yet initiated.</p> </li>
/// <li> <p> <code>IN_PROGRESS</code>: The operation is currently in progress.</p> </li>
/// <li> <p> <code>SUCCESS</code>: The operation has successfully completed.</p> </li>
/// <li> <p> <code>FAILED</code>: The operation has failed.</p> </li>
/// <li> <p> <code>CANCEL_IN_PROGRESS</code>: The operation is currently in the process of being canceled.</p> </li>
/// <li> <p> <code>CANCEL_COMPLETE</code>: The operation has been canceled.</p> </li>
/// </ul>
pub fn operation_statuses(&self) -> std::option::Option<&[crate::model::OperationStatus]> {
self.operation_statuses.as_deref()
}
}
impl std::fmt::Debug for ResourceRequestStatusFilter {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ResourceRequestStatusFilter");
formatter.field("operations", &self.operations);
formatter.field("operation_statuses", &self.operation_statuses);
formatter.finish()
}
}
/// See [`ResourceRequestStatusFilter`](crate::model::ResourceRequestStatusFilter)
pub mod resource_request_status_filter {
/// A builder for [`ResourceRequestStatusFilter`](crate::model::ResourceRequestStatusFilter)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) operations: std::option::Option<std::vec::Vec<crate::model::Operation>>,
pub(crate) operation_statuses:
std::option::Option<std::vec::Vec<crate::model::OperationStatus>>,
}
impl Builder {
/// Appends an item to `operations`.
///
/// To override the contents of this collection use [`set_operations`](Self::set_operations).
///
/// <p>The operation types to include in the filter.</p>
pub fn operations(mut self, input: crate::model::Operation) -> Self {
let mut v = self.operations.unwrap_or_default();
v.push(input);
self.operations = Some(v);
self
}
/// <p>The operation types to include in the filter.</p>
pub fn set_operations(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Operation>>,
) -> Self {
self.operations = input;
self
}
/// Appends an item to `operation_statuses`.
///
/// To override the contents of this collection use [`set_operation_statuses`](Self::set_operation_statuses).
///
/// <p>The operation statuses to include in the filter.</p>
/// <ul>
/// <li> <p> <code>PENDING</code>: The operation has been requested, but not yet initiated.</p> </li>
/// <li> <p> <code>IN_PROGRESS</code>: The operation is currently in progress.</p> </li>
/// <li> <p> <code>SUCCESS</code>: The operation has successfully completed.</p> </li>
/// <li> <p> <code>FAILED</code>: The operation has failed.</p> </li>
/// <li> <p> <code>CANCEL_IN_PROGRESS</code>: The operation is currently in the process of being canceled.</p> </li>
/// <li> <p> <code>CANCEL_COMPLETE</code>: The operation has been canceled.</p> </li>
/// </ul>
pub fn operation_statuses(mut self, input: crate::model::OperationStatus) -> Self {
let mut v = self.operation_statuses.unwrap_or_default();
v.push(input);
self.operation_statuses = Some(v);
self
}
/// <p>The operation statuses to include in the filter.</p>
/// <ul>
/// <li> <p> <code>PENDING</code>: The operation has been requested, but not yet initiated.</p> </li>
/// <li> <p> <code>IN_PROGRESS</code>: The operation is currently in progress.</p> </li>
/// <li> <p> <code>SUCCESS</code>: The operation has successfully completed.</p> </li>
/// <li> <p> <code>FAILED</code>: The operation has failed.</p> </li>
/// <li> <p> <code>CANCEL_IN_PROGRESS</code>: The operation is currently in the process of being canceled.</p> </li>
/// <li> <p> <code>CANCEL_COMPLETE</code>: The operation has been canceled.</p> </li>
/// </ul>
pub fn set_operation_statuses(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::OperationStatus>>,
) -> Self {
self.operation_statuses = input;
self
}
/// Consumes the builder and constructs a [`ResourceRequestStatusFilter`](crate::model::ResourceRequestStatusFilter)
pub fn build(self) -> crate::model::ResourceRequestStatusFilter {
crate::model::ResourceRequestStatusFilter {
operations: self.operations,
operation_statuses: self.operation_statuses,
}
}
}
}
impl ResourceRequestStatusFilter {
/// Creates a new builder-style object to manufacture [`ResourceRequestStatusFilter`](crate::model::ResourceRequestStatusFilter)
pub fn builder() -> crate::model::resource_request_status_filter::Builder {
crate::model::resource_request_status_filter::Builder::default()
}
}