aws-sdk-glue 1.149.0

AWS SDK for AWS Glue
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The statement or request for a particular action to occur in a session.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Statement {
    /// <p>The ID of the statement.</p>
    pub id: i32,
    /// <p>The execution code of the statement.</p>
    pub code: ::std::option::Option<::std::string::String>,
    /// <p>The state while request is actioned.</p>
    pub state: ::std::option::Option<crate::types::StatementState>,
    /// <p>The output in JSON.</p>
    pub output: ::std::option::Option<crate::types::StatementOutput>,
    /// <p>The code execution progress.</p>
    pub progress: f64,
    /// <p>The unix time and date that the job definition was started.</p>
    pub started_on: i64,
    /// <p>The unix time and date that the job definition was completed.</p>
    pub completed_on: i64,
}
impl Statement {
    /// <p>The ID of the statement.</p>
    pub fn id(&self) -> i32 {
        self.id
    }
    /// <p>The execution code of the statement.</p>
    pub fn code(&self) -> ::std::option::Option<&str> {
        self.code.as_deref()
    }
    /// <p>The state while request is actioned.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::StatementState> {
        self.state.as_ref()
    }
    /// <p>The output in JSON.</p>
    pub fn output(&self) -> ::std::option::Option<&crate::types::StatementOutput> {
        self.output.as_ref()
    }
    /// <p>The code execution progress.</p>
    pub fn progress(&self) -> f64 {
        self.progress
    }
    /// <p>The unix time and date that the job definition was started.</p>
    pub fn started_on(&self) -> i64 {
        self.started_on
    }
    /// <p>The unix time and date that the job definition was completed.</p>
    pub fn completed_on(&self) -> i64 {
        self.completed_on
    }
}
impl Statement {
    /// Creates a new builder-style object to manufacture [`Statement`](crate::types::Statement).
    pub fn builder() -> crate::types::builders::StatementBuilder {
        crate::types::builders::StatementBuilder::default()
    }
}

/// A builder for [`Statement`](crate::types::Statement).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StatementBuilder {
    pub(crate) id: ::std::option::Option<i32>,
    pub(crate) code: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::StatementState>,
    pub(crate) output: ::std::option::Option<crate::types::StatementOutput>,
    pub(crate) progress: ::std::option::Option<f64>,
    pub(crate) started_on: ::std::option::Option<i64>,
    pub(crate) completed_on: ::std::option::Option<i64>,
}
impl StatementBuilder {
    /// <p>The ID of the statement.</p>
    pub fn id(mut self, input: i32) -> Self {
        self.id = ::std::option::Option::Some(input);
        self
    }
    /// <p>The ID of the statement.</p>
    pub fn set_id(mut self, input: ::std::option::Option<i32>) -> Self {
        self.id = input;
        self
    }
    /// <p>The ID of the statement.</p>
    pub fn get_id(&self) -> &::std::option::Option<i32> {
        &self.id
    }
    /// <p>The execution code of the statement.</p>
    pub fn code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The execution code of the statement.</p>
    pub fn set_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.code = input;
        self
    }
    /// <p>The execution code of the statement.</p>
    pub fn get_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.code
    }
    /// <p>The state while request is actioned.</p>
    pub fn state(mut self, input: crate::types::StatementState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state while request is actioned.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::StatementState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The state while request is actioned.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::StatementState> {
        &self.state
    }
    /// <p>The output in JSON.</p>
    pub fn output(mut self, input: crate::types::StatementOutput) -> Self {
        self.output = ::std::option::Option::Some(input);
        self
    }
    /// <p>The output in JSON.</p>
    pub fn set_output(mut self, input: ::std::option::Option<crate::types::StatementOutput>) -> Self {
        self.output = input;
        self
    }
    /// <p>The output in JSON.</p>
    pub fn get_output(&self) -> &::std::option::Option<crate::types::StatementOutput> {
        &self.output
    }
    /// <p>The code execution progress.</p>
    pub fn progress(mut self, input: f64) -> Self {
        self.progress = ::std::option::Option::Some(input);
        self
    }
    /// <p>The code execution progress.</p>
    pub fn set_progress(mut self, input: ::std::option::Option<f64>) -> Self {
        self.progress = input;
        self
    }
    /// <p>The code execution progress.</p>
    pub fn get_progress(&self) -> &::std::option::Option<f64> {
        &self.progress
    }
    /// <p>The unix time and date that the job definition was started.</p>
    pub fn started_on(mut self, input: i64) -> Self {
        self.started_on = ::std::option::Option::Some(input);
        self
    }
    /// <p>The unix time and date that the job definition was started.</p>
    pub fn set_started_on(mut self, input: ::std::option::Option<i64>) -> Self {
        self.started_on = input;
        self
    }
    /// <p>The unix time and date that the job definition was started.</p>
    pub fn get_started_on(&self) -> &::std::option::Option<i64> {
        &self.started_on
    }
    /// <p>The unix time and date that the job definition was completed.</p>
    pub fn completed_on(mut self, input: i64) -> Self {
        self.completed_on = ::std::option::Option::Some(input);
        self
    }
    /// <p>The unix time and date that the job definition was completed.</p>
    pub fn set_completed_on(mut self, input: ::std::option::Option<i64>) -> Self {
        self.completed_on = input;
        self
    }
    /// <p>The unix time and date that the job definition was completed.</p>
    pub fn get_completed_on(&self) -> &::std::option::Option<i64> {
        &self.completed_on
    }
    /// Consumes the builder and constructs a [`Statement`](crate::types::Statement).
    pub fn build(self) -> crate::types::Statement {
        crate::types::Statement {
            id: self.id.unwrap_or_default(),
            code: self.code,
            state: self.state,
            output: self.output,
            progress: self.progress.unwrap_or_default(),
            started_on: self.started_on.unwrap_or_default(),
            completed_on: self.completed_on.unwrap_or_default(),
        }
    }
}