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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Specifies the type and size of the endpoint capacity to activate for a blue/green deployment, a rolling deployment, or a rollback strategy. You can specify your batches as either instance count or the overall percentage or your fleet.</p>
/// <p>For a rollback strategy, if you don't specify the fields in this object, or if you set the <code>Value</code> to 100%, then SageMaker uses a blue/green rollback strategy and rolls all traffic back to the blue fleet.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CapacitySize {
/// <p>Specifies the endpoint capacity type.</p>
/// <ul>
/// <li> <p> <code>INSTANCE_COUNT</code>: The endpoint activates based on the number of instances.</p> </li>
/// <li> <p> <code>CAPACITY_PERCENT</code>: The endpoint activates based on the specified percentage of capacity.</p> </li>
/// </ul>
pub r#type: ::std::option::Option<crate::types::CapacitySizeType>,
/// <p>Defines the capacity size, either as a number of instances or a capacity percentage.</p>
pub value: ::std::option::Option<i32>,
}
impl CapacitySize {
/// <p>Specifies the endpoint capacity type.</p>
/// <ul>
/// <li> <p> <code>INSTANCE_COUNT</code>: The endpoint activates based on the number of instances.</p> </li>
/// <li> <p> <code>CAPACITY_PERCENT</code>: The endpoint activates based on the specified percentage of capacity.</p> </li>
/// </ul>
pub fn r#type(&self) -> ::std::option::Option<&crate::types::CapacitySizeType> {
self.r#type.as_ref()
}
/// <p>Defines the capacity size, either as a number of instances or a capacity percentage.</p>
pub fn value(&self) -> ::std::option::Option<i32> {
self.value
}
}
impl CapacitySize {
/// Creates a new builder-style object to manufacture [`CapacitySize`](crate::types::CapacitySize).
pub fn builder() -> crate::types::builders::CapacitySizeBuilder {
crate::types::builders::CapacitySizeBuilder::default()
}
}
/// A builder for [`CapacitySize`](crate::types::CapacitySize).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CapacitySizeBuilder {
pub(crate) r#type: ::std::option::Option<crate::types::CapacitySizeType>,
pub(crate) value: ::std::option::Option<i32>,
}
impl CapacitySizeBuilder {
/// <p>Specifies the endpoint capacity type.</p>
/// <ul>
/// <li> <p> <code>INSTANCE_COUNT</code>: The endpoint activates based on the number of instances.</p> </li>
/// <li> <p> <code>CAPACITY_PERCENT</code>: The endpoint activates based on the specified percentage of capacity.</p> </li>
/// </ul>
/// This field is required.
pub fn r#type(mut self, input: crate::types::CapacitySizeType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>Specifies the endpoint capacity type.</p>
/// <ul>
/// <li> <p> <code>INSTANCE_COUNT</code>: The endpoint activates based on the number of instances.</p> </li>
/// <li> <p> <code>CAPACITY_PERCENT</code>: The endpoint activates based on the specified percentage of capacity.</p> </li>
/// </ul>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::CapacitySizeType>) -> Self {
self.r#type = input;
self
}
/// <p>Specifies the endpoint capacity type.</p>
/// <ul>
/// <li> <p> <code>INSTANCE_COUNT</code>: The endpoint activates based on the number of instances.</p> </li>
/// <li> <p> <code>CAPACITY_PERCENT</code>: The endpoint activates based on the specified percentage of capacity.</p> </li>
/// </ul>
pub fn get_type(&self) -> &::std::option::Option<crate::types::CapacitySizeType> {
&self.r#type
}
/// <p>Defines the capacity size, either as a number of instances or a capacity percentage.</p>
/// This field is required.
pub fn value(mut self, input: i32) -> Self {
self.value = ::std::option::Option::Some(input);
self
}
/// <p>Defines the capacity size, either as a number of instances or a capacity percentage.</p>
pub fn set_value(mut self, input: ::std::option::Option<i32>) -> Self {
self.value = input;
self
}
/// <p>Defines the capacity size, either as a number of instances or a capacity percentage.</p>
pub fn get_value(&self) -> &::std::option::Option<i32> {
&self.value
}
/// Consumes the builder and constructs a [`CapacitySize`](crate::types::CapacitySize).
pub fn build(self) -> crate::types::CapacitySize {
crate::types::CapacitySize {
r#type: self.r#type,
value: self.value,
}
}
}