Skip to main content

aws_sdk_lexruntime/types/
_active_context_time_to_live.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The length of time or number of turns that a context remains active.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ActiveContextTimeToLive {
7    /// <p>The number of seconds that the context should be active after it is first sent in a <code>PostContent</code> or <code>PostText</code> response. You can set the value between 5 and 86,400 seconds (24 hours).</p>
8    pub time_to_live_in_seconds: ::std::option::Option<i32>,
9    /// <p>The number of conversation turns that the context should be active. A conversation turn is one <code>PostContent</code> or <code>PostText</code> request and the corresponding response from Amazon Lex.</p>
10    pub turns_to_live: ::std::option::Option<i32>,
11}
12impl ActiveContextTimeToLive {
13    /// <p>The number of seconds that the context should be active after it is first sent in a <code>PostContent</code> or <code>PostText</code> response. You can set the value between 5 and 86,400 seconds (24 hours).</p>
14    pub fn time_to_live_in_seconds(&self) -> ::std::option::Option<i32> {
15        self.time_to_live_in_seconds
16    }
17    /// <p>The number of conversation turns that the context should be active. A conversation turn is one <code>PostContent</code> or <code>PostText</code> request and the corresponding response from Amazon Lex.</p>
18    pub fn turns_to_live(&self) -> ::std::option::Option<i32> {
19        self.turns_to_live
20    }
21}
22impl ActiveContextTimeToLive {
23    /// Creates a new builder-style object to manufacture [`ActiveContextTimeToLive`](crate::types::ActiveContextTimeToLive).
24    pub fn builder() -> crate::types::builders::ActiveContextTimeToLiveBuilder {
25        crate::types::builders::ActiveContextTimeToLiveBuilder::default()
26    }
27}
28
29/// A builder for [`ActiveContextTimeToLive`](crate::types::ActiveContextTimeToLive).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct ActiveContextTimeToLiveBuilder {
33    pub(crate) time_to_live_in_seconds: ::std::option::Option<i32>,
34    pub(crate) turns_to_live: ::std::option::Option<i32>,
35}
36impl ActiveContextTimeToLiveBuilder {
37    /// <p>The number of seconds that the context should be active after it is first sent in a <code>PostContent</code> or <code>PostText</code> response. You can set the value between 5 and 86,400 seconds (24 hours).</p>
38    pub fn time_to_live_in_seconds(mut self, input: i32) -> Self {
39        self.time_to_live_in_seconds = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The number of seconds that the context should be active after it is first sent in a <code>PostContent</code> or <code>PostText</code> response. You can set the value between 5 and 86,400 seconds (24 hours).</p>
43    pub fn set_time_to_live_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
44        self.time_to_live_in_seconds = input;
45        self
46    }
47    /// <p>The number of seconds that the context should be active after it is first sent in a <code>PostContent</code> or <code>PostText</code> response. You can set the value between 5 and 86,400 seconds (24 hours).</p>
48    pub fn get_time_to_live_in_seconds(&self) -> &::std::option::Option<i32> {
49        &self.time_to_live_in_seconds
50    }
51    /// <p>The number of conversation turns that the context should be active. A conversation turn is one <code>PostContent</code> or <code>PostText</code> request and the corresponding response from Amazon Lex.</p>
52    pub fn turns_to_live(mut self, input: i32) -> Self {
53        self.turns_to_live = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>The number of conversation turns that the context should be active. A conversation turn is one <code>PostContent</code> or <code>PostText</code> request and the corresponding response from Amazon Lex.</p>
57    pub fn set_turns_to_live(mut self, input: ::std::option::Option<i32>) -> Self {
58        self.turns_to_live = input;
59        self
60    }
61    /// <p>The number of conversation turns that the context should be active. A conversation turn is one <code>PostContent</code> or <code>PostText</code> request and the corresponding response from Amazon Lex.</p>
62    pub fn get_turns_to_live(&self) -> &::std::option::Option<i32> {
63        &self.turns_to_live
64    }
65    /// Consumes the builder and constructs a [`ActiveContextTimeToLive`](crate::types::ActiveContextTimeToLive).
66    pub fn build(self) -> crate::types::ActiveContextTimeToLive {
67        crate::types::ActiveContextTimeToLive {
68            time_to_live_in_seconds: self.time_to_live_in_seconds,
69            turns_to_live: self.turns_to_live,
70        }
71    }
72}